2. (15 pts) Algorithms running time analysis.
Master theorem If $T(n) = aT(n/b) + O(n^d)$ for some constants $a > 0$, $b > 1$ and $d \ge 0$, then
$T(n) = \begin{cases}
O(n^d) & \text{if } d > \log_b a \\
O(n^d \log n) & \text{if } d = \log_b a \\
O(n^{\log_b a}) & \text{if } d < \log_b a
\end{cases}$
(a) Analyze the worst case running time of the following function, and then write the big-Theta notation of the running time.
bool IsPalindrome (string s)
{
if (len(s)==1)
return true;
int left = 0;
int right = len(s)-1;
while left <=right {
if (s[left]!=s[right])
return false;
left = left +1;
right=right-1;
}
return true;
}