Koneru Lakshmaiah Education Foundation
(Deemed to be University)
FRESHMAN ENGINEERING DEPARTMENT
A Project Based Lab Report
On
TRICKY TOWER
SUBMITTED BY:
I.D NUMBER NAME
2400033326 K. JOHN SHREYAN
2400033327 S. MOHAN SAI CHANDRA SEKHAR
2400033339 SK. AMAR
2400040067 P. JESHWANTH
UNDER THE GUIDANCE OF
PRIYA DARSHAN SIR
Senior Professor, CSE.
KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.
DEPARTMENT OF BASIC ENGINEERING SCIENCES-1
CERTIFICATE
This is to certify that the project based laboratory report entitled
“TRICKY TOWER” submitted by Mr. S.MOHAN SAI CHANDRA SEKHAR bearing Regd. No.
2400033327 by Mr. K.JOHN SHREYAN bearing Regd. No. 2400033326 by Mr. SK. AMAR
bearing Regd. No. 2400033339 by Mr. P.JESWANTH bearing Regd. No. 2400040436 to the
Department of Basic Engineering Sciences-1, KL University in partial fulfillment of the
requirements for the completion of a project based Laboratory in “Computational
Thinking for Structural Design ”course in I B Tech I Semester, is a Bonafide record of the
work carried out by them under my supervision during the academic year 2024 – 2025.
PROJECT SUPERVISOR HEAD OF THE DEPARTMENT
MR. PRIYA DARSHAN DR. HARITHA
ACKNOWLEDGEMENTS
It is great pleasure for me to express my gratitude to our honorable President Sri.
Koneru Satyanarayana, for giving the opportunity and platform with facilities in
accomplishing the project-based laboratory report.
I express the sincere gratitude to our Director Dr. A. Jagadeesh for his
administration towards our academic growth.
I express sincere gratitude to HOD-BES-1 Dr. D. Haritha for her leadership and
constant motivation provided in successful completion of our academic semester. I record
it as my privilege to deeply thank for providing us the efficient faculty and facilities to make
our ideas into reality.
I express my sincere thanks to our project supervisor Mr. Priya Darshan for his
novel association of ideas, encouragement, appreciation and intellectual zeal which
motivated us to venture this project successfully.
Finally, it is pleased to acknowledge the indebtedness to all those who devoted
themselves directly or indirectly to make this project report success.
Project Associates…
K.JOHN SHREYAN
S.MOHAN SAI CHANDRA SEKHAR
SK.AMAR
P.JESWANTH
INDEX
S.NO TITLE PAGE NO
1 Introduction 1
2 Aim of the Project 2
2.1 Advantages & Disadvantages 3-4
3 Software & Hardware Details 5
4 Flow Chart 6
5 Algorithm 7
6 Implementation 8
7 Integration and System Testing 9
8 Conclusion 10
INTRODUCTION
Concepts:
Recursion is a fundamental concept in programming where a function
invokes itself repeatedly until it reaches a base case that stops the
recursion.
1. Base Case: A condition that stops the recursion.
2. Recursive Call: The function calls itself.
3. State Transition: The function's state changes with each call.
Example: Factorial Function
int factorial(int n) {
// Base case
if (n == 0 || n == 1) {
return 1;
// Recursive call
else {
return n * factorial(n - 1);
}
AIM
The aim of the Tower of Hanoi puzzle is to move a stack of disks from one rod
to another, following these rules:
1. Only one disk can be moved at a time.
2. A disk can only be placed on top of a larger disk or an empty rod.
3. All disks start on one rod in decreasing size, and the goal is to recreate
this configuration on another rod.
ADVANTAGES & DISADVANTAGES
3
Advantages:-
1. Simplifies complex problems.
2. Reduces code size.
3. Easier to understand and implement.
Disadvantages:-
1. Higher memory usage.
2. Risk of stack overflow.
3. Slower execution.
Future Enhancements:-
Algorithmic Enhancements:
1. Memorization: Store results of expensive function calls to avoid redundant calculations.
2. Dynamic Programming: Break problems into smaller sub-problems and store
solutions.
3. Parallel Processing: Utilize multi-core processors to speed up recursive calculations.
4. Optimized Data Structures: Improve performance using efficient data structures (e.g.,
trees, graphs).
Functional Enhancements:
1. Support for Various Data Types: Handle different data types (e.g., strings, arrays,
objects).
2. Error Handling: Implement robust error handling mechanisms.
3. Debugging Tools: Integrate debugging tools for easier issue identification.
4. Code Optimization: Minify and compress code for better performance.
User Interface Enhancements:
1. Visualizations: Implement graphical representations of recursive processes.
2. Interactive Tools: Provide interactive interfaces for users to explore recursion.
3. Documentation: Generate automatic documentation for recursive functions.
4. Testing Frameworks: Integrate testing frameworks for recursive algorithms.
Machine Learning Integrations:
1. Predictive Modeling: Use machine learning to predict optimal recursive strategies.
2. Automated Optimization: Utilize ML to optimize recursive algorithms.
3. Anomaly Detection: Identify unusual patterns in recursive processes.
4. Recommendation Systems: Suggest optimal recursive approaches.
Cloud and Distributed Computing:
1. Distributed Recursion: Execute recursive tasks across multiple nodes.
2. Cloud-Based Services: Offer scalable recursive computation services.
3. Load Balancing: Balance recursive workload across multiple processors.
4. Fault Tolerance: Ensure recursive computations continue despite node failures.
Security Enhancements:
1. Encryption: Secure recursive data with encryption algorithms.
2. Access Control: Implement access controls for recursive functions.
3. Input Validation: Validate user input to prevent malicious attacks.
4. Secure Communication: Establish secure communication channels.
SOFTWARE & HARDWARE DETAILS
SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:
Language : C
Operating System: Windows Xp or later.
HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as
follows:
RAM :16GB (8 GB or more recommended)
Processor :Intel Core i5 or equivalent (i5 or i7 recommended)
6
FLOW CHART
ALGORITHM
Step 1: Start
Step 2: Initialize
- Number of disks (n)
- Source rod (A)
- Destination rod (C)
- Auxiliary rod (B)
Step 3: Main Loop
1. Base Case
- If n = 1
- Move disk 1 from A to C
- End
- Else
Step 4: Recursive Step
- Move n-1 disks from A to B (using C)
Step 5: Recursive Call
- Move nth disk from A to C
- Move n-1 disks from B to C (using A)
Step 6: Recursive Call
Step 7: End
IMPLEMENTATION
#include <stdio.h>
void towerOfHanoi(int n, char fromRod, char toRod, char auxRod) {
if (n == 1) {
printf("Move disk 1 from rod %c to rod %c\n", fromRod, toRod);
return;
towerOfHanoi(n - 1, fromRod, auxRod, toRod);
printf("Move disk %d from rod %c to rod %c\n", n, fromRod, toRod);
towerOfHanoi(n - 1, auxRod, toRod, fromRod);
int main() {
int n = 3; // Number of disks
towerOfHanoi(n, 'A', 'C', 'B');
return 0;
}
INTEGRATION AND SYSTEM TESTING
OUTPUTS
Screen Shots:
CONCLUSION
Tower of Hanoi Project
The conclusion of the Tower of Hanoi puzzle is that it demonstrates the power and
elegance of recursive problem-solving. It teaches:
1. Logical Thinking: Breaking down a complex problem into smaller, manageable
steps.
2. Efficiency: Finding the optimal solution in 2^n - 1 moves, showcasing mathematical
precision.
3. Algorithmic Design: A practical example of recursion, a foundational concept in
computer science.
By successfully solving the Tower of Hanoi, one gains a deeper understanding of structured
problem-solving and recursive reasoning, applicable in programming, mathematics, and
decision-making processes.