CPP Recursion MCQ
Cpp MCQ(1) Which of the following is property of recursive function?
A) Base condition
B) Call to itself
C) Return Value
D) All
Explanation
All of these are properties of recursive functions.
(2) Which of the following control structure is alternative of recursion?
A) Iteration
B) Selection
C) Sequence
D) None
Explanation
Iterative structure is an alternative solution of recursion. We can solve all recursive problems with the help of iteration.
(3) Which of the following are types of recursion?
A) Direct
B) Indirect
C) Tail
D) All
Explanation
Direct, indirect and tail all of these are types of recursion.
(4) Which of the following data structure is used for recursive call?
A) Queue
B) Stack
C) Tree
D) Hash
Explanation
Stack (LIFO) order data structure is used to track recursive calls.
(5) How many base conditions are specified in recursive function?
A) One
B) Two
C) None
D) Multiple
Explanation
There are required one base condition in recursive function.