Csit Notes

Define queue as ADT and discuss about primitive operations in queue. Trace the output generated by following recursive…

  • CSC211
  • Core Course
  • Question 3 · 2082 B.S.

Define queue as ADT and discuss about primitive operations in queue. Trace the output generated by following recursive function for the statement TOH(4,1,3). ``` TOH(n,s,d) { if (n==1) { printf(" move the top disk from rod %d to rod %d",s,d) } else { TOH (n-1,s,6-s-d) printf("move the top disk from rod %d to rod %d",s,d) TOH (n-1, 6-s-d, d) } } ```

Answer

The verified answer for this question is being prepared. Meanwhile, the chapter notes cover this topic, and you can contribute your own solution.