Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Recursion Visualizer (C++)

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.


πŸ“Œ Project Objective

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

πŸš€ Features

1️⃣ Factorial Calculator

Computes factorial recursively.

Example:

Input : 5
Output: 120

2️⃣ Fibonacci Calculator

Computes Fibonacci numbers recursively.

Example:

Input : 7
Output: 13

3️⃣ Recursive Countdown

Prints numbers recursively until the base case is reached.

Example:

Input : 5

Output:
5
4
3
2
1

4️⃣ Tower Of Hanoi Simulator

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

πŸ“‚ Project Structure

recursion-visualizer-cpp/

β”œβ”€β”€ include/
β”‚   β”œβ”€β”€ menu.h
β”‚   └── recursion.h
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.cpp
β”‚   β”œβ”€β”€ menu.cpp
β”‚   └── recursion.cpp
β”‚
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
└── .gitignore

πŸ›  Technologies Used

  • C++17
  • GNU G++
  • Modular Programming
  • Header Files
  • Source Files
  • Recursive Algorithms

🧠 Concepts Practiced

Recursion Fundamentals

  • Base Case
  • Recursive Case
  • Call Stack
  • Recursive Function Design

Recursive Problems

  • Factorial
  • Fibonacci
  • Countdown
  • Tower Of Hanoi

Program Design

  • Menu Driven Applications
  • Function Decomposition
  • Modular Structure
  • Input/Output Handling

▢️ Build & Run

Compile:

g++ src/main.cpp src/menu.cpp src/recursion.cpp \
-Iinclude \
-Wall -Wextra -pedantic \
-std=c++17 \
-o app

Run:

./app

πŸ“ˆ Learning Outcome

This 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.


🎯 Project Status

βœ… Completed


πŸ‘¨β€πŸ’» Author

Mehfooz

GitHub: https://github.com/whoismehfooz

About

πŸ‘‰ A C++ recursion learning project featuring Factorial, Fibonacci, Countdown, and Tower of Hanoi implementations through a menu-driven console application.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages