Loading practice questions
What is the recurrence relation for the linear search recursive algorithm?
Correct Answer: C — T(n-1)+c
Explanation:
After each call in the recursive algorithm, the size of n is reduced by 1. Therefore the optimal solution is T(n-1)+c.