Is there any facility in the standard Java libraries that, given a CharSequence, produces the reverse in O(1) time?
I guess this is \"easy\" to implement, just wond
StringBuffer has a reverse: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html#reverse()
BTW, I assume you meant O(n) because O(1) (as other people have mentioned) is obviously impossible.