1.

What are recursive algorithms? State the important rules which every recursive algorithm must follow.

Answer»

Recursive ALGORITHM is a way of tackling a difficult problem by breaking it down into smaller and smaller subproblems until the problem is small enough to be solved quickly. It usually involves a function that calls itself (PROPERTY of recursive functions).

The THREE laws which must be followed by all recursive ALGORITHMS are as follows:

  • There should be a base case.
  • It is NECESSARY for a recursive algorithm to call itself.
  • The state of a recursive algorithm must be changed in order for it to return to the base case.


Discussion

No Comment Found