Skip to content

mmohamedkhaled/Towers-of-Hanoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Towers of Hanoi using Stack Template Class

This C++ program demonstrates the Towers of Hanoi puzzle solution using a stack template class Stackt. The Towers of Hanoi is a classic problem in computer science and recursion.

Overview

The program consists of the following files:

  • main.cpp: Contains the main logic for Towers of Hanoi and stack operations.
  • Stackt.h: Header file for the Stackt template class.
  • Stackt.cpp: Implementation file for the Stackt template class.

Files Description

  • main.cpp:

    • Implements the Towers of Hanoi algorithm using recursion.
    • Uses a custom stack implementation from Stackt.h for the pegs.
    • Displays the state of pegs at each step of the solution.
  • Stackt.h:

    • Defines the Stackt template class for stack operations.
    • Includes methods for push, pop, top, and checking stack size/empty/full.
  • Stackt.cpp:

    • Implements the methods of the Stackt template class defined in Stackt.h.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages