2080 7

BIT201 ยท 2080 ยท 5 marks

Define recursion. Explain Tower of Hanoi (TOH) with example.

Define recursion. Explain Tower of Hanoi (TOH) with example. [5]

Data Structures and AlgorithmsChapter 5: Recursion and Advanced TechniquesTower of Hanoi algorithm and tracing

Recursion is a programming technique in which a function calls itself directly or indirectly to solve a problem. A recursive function solves a problem by breaking it down into smaller subproblems of the same type until it reaches a base case (terminating condition) that can be solved directly wit...