CMSC132 Exam 2
Verified Exam Questions and Answers Latest update 2026/2027
Question:
Recursion -
Answer:
A strategy for solving problems where a method calls
itself
Recursion relies on the runtime call stack
'every method invocation gets its own stack space
Question:
Tail recursion -
Answer:
Single recursive call thats the last thing
performed in the method
'can easily be turned into a loop
Question:
Non-tail recursion -
Answer:
The recursive call are not performed last in
the method
Question:
Recursion vs. Iteration -
, Answer:
Iterative are more efficient
'b/c it avoids the overhead recursive method calls
-Recursive algorithms
'have higher overhead
'sometimes simpler
'are natural for backtracking searches
'suited for recursive data structures
Question:
Trees -
Answer:
Recursive data structure that have a one-to-many
relationship between elements
Question:
Root -
Answer:
No parent
Question:
Leaf -
Answer:
No children
Question:
Interior Nodes -
Answer:
A node with at least one child
Question:
Siblings -
Answer:
Have same parent
Verified Exam Questions and Answers Latest update 2026/2027
Question:
Recursion -
Answer:
A strategy for solving problems where a method calls
itself
Recursion relies on the runtime call stack
'every method invocation gets its own stack space
Question:
Tail recursion -
Answer:
Single recursive call thats the last thing
performed in the method
'can easily be turned into a loop
Question:
Non-tail recursion -
Answer:
The recursive call are not performed last in
the method
Question:
Recursion vs. Iteration -
, Answer:
Iterative are more efficient
'b/c it avoids the overhead recursive method calls
-Recursive algorithms
'have higher overhead
'sometimes simpler
'are natural for backtracking searches
'suited for recursive data structures
Question:
Trees -
Answer:
Recursive data structure that have a one-to-many
relationship between elements
Question:
Root -
Answer:
No parent
Question:
Leaf -
Answer:
No children
Question:
Interior Nodes -
Answer:
A node with at least one child
Question:
Siblings -
Answer:
Have same parent