C Halbe wrote:So I guess, if someone asks me how to reverse a string "in-place" I will have no choice but to implement it in C/C++
Jeff Verdegan wrote:
Your other choice is to tell them to take a hike.
C Halbe wrote:
Jeff Verdegan wrote:
Your other choice is to tell them to take a hike.
LOL....I was just asking this because this is asked in interviews. If asked, I will have to show the implementation in other language, not Java.![]()
Mike Simmons wrote:Indeed - you can even use StringBuilder.reverse() to achieve this.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Dennis Deems wrote:
Mike Simmons wrote:Indeed - you can even use StringBuilder.reverse() to achieve this.
That wouldn't be much of an exercise.![]()
Campbell Ritchie wrote:But remember in Java™ “An Array of Characters is not a String”.