title: Time Complexity in Reversing a C++ String
body: <p>I have a problem on my homework to reverse the words in a C++ string, in place, with only O(1) additional memory. I'm confused by what it means O(1) additional memory. I understand what O(1) generally means, where no matter how big the input is, the time to compute will be constant so I'm guessing I should add only one piece of memory that would keep track of the words in reverse. Any suggestions?</p>