Algo stl quiz doubt

A student just learnt the reverse() function in c++ STL. He writes the following algorithm to check if a given string S is a palindrome.

bool isPalindrome(string& s)
string rev = s
reverse(rev.begin(), rev.end())
return s == rev
Is the algorithm correct? What is the space and time complexity?
whyans is d

since you made an extra string of same size as s, so it uses O(N) extra space and since s == rev is O(N) operation the time complexity is also O(N)