Question: 1 -
Java uses Stack type memory instead of Heap type memory in implementing Recursion because of ___ feature of STACK.
-
LIFO (Last In First Out)
-
Round Robin
-
None of these
-
FIFO (First In First Out)
Answer:
LIFO (Last In First Out)
Solution:
Recursion unwinds and completes all methods from the latest to the oldest. So, it requires the LIFO strategy offered by Stack memory.
Recursion unwinds and completes all methods from the latest to the oldest. So, it requires the LIFO strategy offered by Stack memory.
Question: 2 -
Which is better in terms of memory utilization Recursion or Loops in Java?
-
Loops
-
Flow control
-
Methods
-
Recursion
Answer:
Loops
Solution:
Loops or iterations are better memory-optimized than Recursion technique that solely depends on the Stack memory.
Loops or iterations are better memory-optimized than Recursion technique that solely depends on the Stack memory.
Question: 3 -
Recursion in Java applies to ___.
-
Methods
-
Variables
-
Constructors
-
Blocks
Answer:
Methods
Solution not available.
Question: 4 -
Uses are Recursion in Java are___.
-
Traversing the nodes of a Binary Tree
-
Traversing folders and files on a disk
-
All the above
-
Evaluating Nth order equations and Factorials
Answer:
All the above
Solution not available.
Question: 5 -
Java uses ___ type of memory to implement Recursion.
-
Register
-
Stack
-
Heap
-
None of these
Answer:
Stack
Solution:
Yes. Java uses Stack type memory to implement Recursion.
Yes. Java uses Stack type memory to implement Recursion.