The optimal data structure used to solve Tower of Hanoi is _________

thanhthao

New member
The optimal data structure used to solve Tower of Hanoi is _________
A. Tree
B. Heap
C. Priority queue
D. Stack
 
Answer: D
Explanation: The Tower of Hanoi involves moving of disks ‘stacked’ at one peg to another peg with respect to the size constraint. It is conveniently done using stacks and priority queues. Stack approach is widely used to solve Tower of Hanoi.
 

Tìm kiếm

Back
Top