Question 76
Which of the following algorithms use recursive backtracking?
Detailed Solution
N-Queens, Sudoku, and Maze routing rely on recursive backtracking. Kruskal's algorithm uses greedy disjoint-set methods.
Which of the following algorithms use recursive backtracking?
N-Queens, Sudoku, and Maze routing rely on recursive backtracking. Kruskal's algorithm uses greedy disjoint-set methods.
Consider the following recursive function:
int f(int n) {
if (n <= 1) return 1;
return f(n - 1) + f(n - 2);
}
Which of the following statements are TRUE?Un-memoized recursive Fibonacci executes in $O(2^n)$ time due to repeating identical subproblem branches.
Which of the following properties are true for function call stacks in C recursion?
Stack frames push/pop sequentially and hold parameters and return addresses. Stack size is strictly bounded by the OS.
Which of the following function definitions are tail-recursive?
Tail-recursive functions have no arithmetic operations waiting after the recursive call returns.
Which of the following represent valid base cases for recursively traversing a singly linked list?
head == NULL handles empty lists / list end; head->next == NULL handles single node / last node. Data values do not dictate base structure.