1. Computer Science Engineering (CSE)
  2. Design and Analysis of Algorithms
  3. What is the time complexity of the above...
Q.

What is the time complexity of the above code used to reverse a string?

A. copies a string to another string
B. compares two strings
C. reverses a string
D. checks if a string is a palindrome
Answer» D. checks if a string is a palindrome
Explanation: the main purpose of the above code is to check if a string is a palindrome.

Discussion