Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
ICT BYTE Logo ICT BYTE

Nepal's #1 Tech Blog

ICT BYTE Logo ICT BYTE

Nepal's #1 Tech Blog

  • HOME
  • GADGETS
    • MOBILE
    • LAPTOPS
    • SMARTWATCH
    • TABLETS
  • EVENTS
  • NEPAL
    • Banking
    • B.Sc. CSIT
    • BCA
  • MCS
    • 1st Sem
      • Managerial Communication
      • Object Oriented Programming
      • Open Source Technology
      • Design and Analysis of Algorithm
    • 2nd Sem
    • 3rd Sem
    • 4th Sem
  • Utility Tools
    • .np Cover Letter Generator
    • Image Size Reducer
  • HOME
  • GADGETS
    • MOBILE
    • LAPTOPS
    • SMARTWATCH
    • TABLETS
  • EVENTS
  • NEPAL
    • Banking
    • B.Sc. CSIT
    • BCA
  • MCS
    • 1st Sem
      • Managerial Communication
      • Object Oriented Programming
      • Open Source Technology
      • Design and Analysis of Algorithm
    • 2nd Sem
    • 3rd Sem
    • 4th Sem
  • Utility Tools
    • .np Cover Letter Generator
    • Image Size Reducer
Subscribe
Close

Search

Trending Now:
nepal budget latest tech updates trends
News

What is the “Tower of Hanoi?”

By ICT Byte
2 Min Read
0

Last Updated on 6 years ago by ICT Byte

Tower of Honai: The tower of Hanoi was invented by a French mathematician Édouard Lucas in the 19th century.

Tower of Honai. Image: HackerEarth

A Tower of Honai is simply a game problem. It is based on three pegs i.e source, middle and destination and a set of a disk of the different sizes.

Each disk has a hole in the centre so that it can be stacked on any of the pegs. Here we have to see how we can use recursion to produce a logical solution.

Recursion is a technique of defining anything in terms of itself. Recursion is mainly use in terms of game development.

if n=3;

Then, the number of steps=2^n-1

=2^3-1

=7

Here,n is the number of the disk. The main aim is the movement of the disk. So,the rules for the movement of the disk are:

1. Only one disc can be moved at a time.

2.Each disk must be stacked on any one of the pegs.

3.Transferring the disk from the source peg to the destination peg such that at any point of transformation no lager size disk is placed on the smaller one.

Algorithm for Tower of Hanoi:

  1. Move the top n-1 disk from source peg to middle peg.
  2. Move the bottom most peg nth disk of source peg to destination peg.
  3. Move n-1 disk stacked on middle peg to destination peg.

Application of Tower of Hanoi

  1. It is frequently used in the psychological research of problem-solving.
  2. It is used in the neuropsychological diagnosis and treatment of the executive functions.
  3. It is also used to teach the recursive algorithm for the beginners of the programming student.

Tower of Hanoi is common dynamic programming which is used in the various programming challenges.

Tags:

algorithm of tower of hanoidata structure and algorithmtower of hanoi
Author

ICT Byte

Follow Me
Other Articles
Forbes 30 under 30 Entrepreneurs
Previous

Meet The 3 Entrepreneurs from Nepal Under Forbes 30 Under 30 Asia: Class Of 2020

top 7 digital wallets in nepal 2020
Next

Top 7 Digital Wallets in Nepal – 2020

Copyright 2026 — ICT BYTE. All rights reserved. Blogsy WordPress Theme