hien
Posts: 2
Nickname: hien
Registered: Apr, 2003
|
|
Re: Reverse a string with recursion and iteration
|
Posted: Apr 17, 2003 2:37 PM
|
|
I have a class RString. I can't use the predefined methods except for charAt(),concatenation(+) and length(). I need to reverse a string, get the position of a particular character, check the two RStrings for equality(equals method(if teh same exact characters are in the same order adn return true if the Rstrings are identical, false otherwise. I also need to check to see if the string is a palindrome and be able to remove a character in the string. all this is in recursion. I only have so far iterations and kinda hard to do recursion. PLease help!
so my methods will be constructor: public RString(String s) value = s;
public String toString() return value;
public in indedOf(char c)
public boolean equals(RString other)
public removeAll(char c)
public reverse()
public boolean isPalindrome(String s)
|
|