1. Both a() and b() aren’t tail recursive
2. Both a() and b() are tail recursive
3. b() is tail recursive but a() isn’t
4. a() is tail recursive but b() isn’t
b() is tail recursive but a() isn’t
1. Every recursive function must have a base case
2. Infinite recursion can occur if the base case isn’t properly mentioned
3. A recursive function makes the code easier to understand
4. Every recursive function must have a return value
Every recursive function must have a return value
1. 50
2. 100
3. 74
4. Infinite loop
100
1. True
2. False
False
1. Program gets into an infinite loop
2. Program runs once
3. Program runs n number of times where n is the argument given to the function
4. An exception is thrown
Program gets into an infinite loop
1. Making the code look clean
2. A complex task can be broken into sub-problems
3. Recursive calls take up less memory
4. Sequence generation is easier than a nested iteration
Recursive calls take up less memory
1. It’s easier to code some real-world problems using recursion than non-recursive equivalent
2. Recursive functions are easy to debug
3. Recursive calls take up a lot of memory
4. Programs using recursion take longer time than their non-recursive equivalent
Recursive functions are easy to debug
1. 0 1 2 3
2. An exception is thrown
3. 0 1 1 2 3
4. 0 1 1 2
0 1 1 2
1. Shallow copy
2. Deep copy
3. memberwise
4. All of the mentioned
Shallow copy
1. [88, 2, 3, [4, 5]][88, 2, 3, [4, 5]]
2. [2, 3, [4, 5]][88, 3, [4, 5]]
3. [88, 2, 3, [4, 5]][2, 3, [4, 5]]
4. [2, 3, [4, 5]][2, 3, [4, 5]]
[2, 3, [4, 5]]
[88, 3, [4, 5]]