adplus-dvertising
frame-decoration

Question

Tower of hanoi is a classic example of

a.

divide and conquer

b.

recursive approach

c.

B but not A

d.

Both A & B

Answer: (d).Both A & B

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Tower of hanoi is a classic example of

Similar Questions

Discover Related MCQs

Q. Recursion uses more memory space than iteration because

Q. A procedure that calls itself is called

Q. If there's no base criteria in a recursive program, the program will

Q. An algorithm that calls itself directly or indirectly is known as

Q. Which Data Structure is used to perform Recursion?

Q. What’s happen if base condition is not defined in recursion ?

Q. It is necessary to declare the type of a function in the calling program if the function

Q. Running out of memory may occur due to

Q. When a function is recursively called, all automatic variables

Q. Predict output of following program
Consider the following recursive function fun(x, y). What is the value of fun(4, 3)
int fun(int x, int y)
{
  if (x == 0)
    return y;
  return fun(x - 1,  x + y);
}

Q. What does the following function print for n = 25?
void fun(int n)
{
  if (n == 0)
    return;
 
  printf("%d", n%2);
  fun(n/2);

Q. ________________ is a powerful technique which is used to invoke a function.

Q. A function, which invokes itself repeatedly until some condition is satisfied, is called a_________.

Q. The number of recursive calls is limited to the _____ of the stack.

Q. Two or more functions, which invoke (call) each other, are called_________________.

Q. For certain problems, a recursive solution is ____________as in the case of factorial of a number.

Q. A recursive function is often less efficient compared to an iterative function. But it is more________.

Q. An iterative function is preferred when its recursive equivalent is__________.

Q. What is a good approach to remove recursion from an algorithm?

Q. A subroutine can be coded so that it may call itself recursively, at___________, in order to perform its task.