InterviewSolution
Saved Bookmarks
| 1. |
What is the time complexity of the above recursive implementation used to reverse a string?(a) O(1)(b) O(n)(c) O(n^2)(d) O(n^3)The question was asked in an internship interview.This key question is from String Reversal using Recursion in section Recursion of Data Structures & Algorithms II |
|
Answer» RIGHT CHOICE is (b) O(n) For explanation: The time complexity of the above recursive implementation used to reverse a STRING is O(n). |
|