![]() In general, Time complexity can be written as 1+2+2^2+2^3+.+2^(n-1) Number of Disks Minimum number of disk movements of disk movements can be written as follows. of disks=2, moving top 1 disk form source to auxiliary and move left over disk on start pole to end pole and then move auxiliary tower disk to end pole, on the whole constituting minimum of 3 disk movements. ![]() For no.of disks =1, moving from source to destination requires only 1 movement. ![]() We devise time complexity by looking at different number of disks, which would take the minimum number of disk movements.
0 Comments
Leave a Reply. |