What is the worst case runtime of linear search(recursive) algorithm?
O(n)
O(logn)
O(n^{2})
O(nx)
Correct Answer: A — O(n)
Explanation:
In the worst case scenario, there might be a need of calling the stack n times. Therfore O(n).