Skip to main content
edited tags; edited title
Link
200_success
  • 145.7k
  • 22
  • 191
  • 481

Reverse a string O(n/2)

Post Closed as "Not suitable for this site" by Morwenn, Mast, Pimgd, tim, Ethan Bierlein
Source Link

Reverse a string O(n/2)

I use this for reversing a string, but it has O(n) :

reverse(y.begin(),y.end());

How can I reverse a string in O(n/2) ?