A console-based C++ project built to understand recursion through practical implementations and visualization of recursive problem solving.
This project focuses on developing recursive thinking rather than simply memorizing recursive syntax.
The goal of this project is to build a strong foundation in recursion by implementing classic recursive problems and understanding how recursive calls move through the call stack.
By completing this project, the following concepts are reinforced:
- Recursive Functions
- Base Cases
- Recursive Cases
- Call Stack Flow
- Problem Decomposition
- Mathematical Recursion
- Recursive Printing
- Recursive Tree Expansion
- Tower of Hanoi Strategy
Computes factorial recursively.
Example:
Input : 5
Output: 120
Computes Fibonacci numbers recursively.
Example:
Input : 7
Output: 13
Prints numbers recursively until the base case is reached.
Example:
Input : 5
Output:
5
4
3
2
1
Displays the sequence of moves required to solve the Tower Of Hanoi puzzle.
Example:
Move disk 1 from A to B
Move disk 2 from A to C
Move disk 1 from B to C
recursion-visualizer-cpp/
βββ include/
β βββ menu.h
β βββ recursion.h
β
βββ src/
β βββ main.cpp
β βββ menu.cpp
β βββ recursion.cpp
β
βββ README.md
βββ LICENSE
βββ .gitignore
- C++17
- GNU G++
- Modular Programming
- Header Files
- Source Files
- Recursive Algorithms
- Base Case
- Recursive Case
- Call Stack
- Recursive Function Design
- Factorial
- Fibonacci
- Countdown
- Tower Of Hanoi
- Menu Driven Applications
- Function Decomposition
- Modular Structure
- Input/Output Handling
Compile:
g++ src/main.cpp src/menu.cpp src/recursion.cpp \
-Iinclude \
-Wall -Wextra -pedantic \
-std=c++17 \
-o appRun:
./appThis project serves as a bridge between basic C++ programming and upcoming Data Structures & Algorithms topics.
After completing this project, recursive problem solving becomes significantly easier and concepts such as Tree Traversal, Backtracking, Divide & Conquer, and Graph Algorithms become more approachable.
β Completed
Mehfooz
GitHub: https://github.com/whoismehfooz