In java you can do this, take O(n) time. Is that correct?
-Adi
public class ReverseString {
public static void main(String[] args){
String name = "Aditya";
String reverse = "";
for(int i=0;i<name.length();i++){
System.out.println(name.charAt(i) + reverse);
reverse = name.charAt(i) + reverse;
}
}
}
On Sat, May 28, 2011 at 6:40 AM, abc abc <[email protected]> wrote:
> *Given an array of characters. How would you reverse it. ? How would you
> reverse it without using indexing in the array.*
> *
> *
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.