0% found this document useful (0 votes)
6 views2 pages

pgm3 TOH

The document describes an experiment related to the Tower of Hanoi problem involving a specified number of disks. It includes a program that calculates and outputs the sequence of moves required to solve the problem. The output indicates the number of moves and the specific actions taken for each disk.

Uploaded by

Hima Hima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

pgm3 TOH

The document describes an experiment related to the Tower of Hanoi problem involving a specified number of disks. It includes a program that calculates and outputs the sequence of moves required to solve the problem. The output indicates the number of moves and the specific actions taken for each disk.

Uploaded by

Hima Hima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Date:

Experiment No.: 5 Page No.: 5

progiam Io belue E7 Hanoi problm and

nmbu of disks

tch (n, áoun u imp dust)?


global ount

toh n- , bowse, cuot , Iimp)


pint (f" Moue

toh Cn- mp boura,dust)

Jimp
dust D

o diks: "))
n int inpur "na thu nunbul
)
print sequunu
h (n, oru tmp diet)
print " Thu Numbn Mous ou)
Output i
Enaa numbr disks :3
Sequence is :
Moue isk 1s ’ D
Moue Disk 25 ’ T
Mo iók
Diok 1D ’-’T
T
Moue Risk 3S ’D
Moue isk 1‘ ’S
Moue aisk 2T ’ D

Thu Numb moues7

You might also like