GithubHelp home page GithubHelp logo

toannguyenkhanh / hanoi-tower-project-using-stack Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 454 KB

This repository contains the implementation of the HaNoi Tower problem using the stack data structure in the context of learning about data structures and algorithms.

C# 100.00%

hanoi-tower-project-using-stack's Introduction

This project implements the classic Tower of Hanoi problem using a stack data structure in C#. The Tower of Hanoi is a mathematical puzzle that involves three rods and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape.

Demo video

Result

The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:

Only one disk can be moved at a time.
Each move consists of taking the top disk from one stack and placing it on top of another stack i.e., a disk can only be moved if it is the uppermost disk on a stack.
No disk may be placed on top of a smaller disk.

Files Included:

Program.cs: This file contains the main implementation of the Tower of Hanoi problem using a stack data structure. It includes the necessary functions to solve the problem recursively.

Stack.cs: This file contains the definition of the Stack class, which is used to implement the stack data structure.

README.md: This readme file provides information about the project, its purpose, and how to use it.

How to Use:

Clone or download the repository to your local machine.

Open the project in your favorite C# development environment, such as Visual Studio or Visual Studio Code.

Build and run the project.

Follow the on-screen instructions to input the number of disks and see the steps to solve the Tower of Hanoi problem.

Contributing:

Contributions to this project are welcome. If you find any issues or have suggestions for improvement, feel free to open an issue or create a pull request.

License:

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments:

This project was inspired by the classic Tower of Hanoi problem and the concept of using stacks to solve it. Special thanks to the developers and contributors of the C# language and .NET framework for providing the foundation for implementing the stack data structure in C#.

hanoi-tower-project-using-stack's People

Contributors

toannguyenkhanh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.