ioana
public text v1 · immutable public static String makePalindrome(String s)
// pre: s is not null
// post: creates and returns the String s concatenated with
// the reverse of s
{ if (s.length() == 1){
String b = s + s;
return b;
}else{
//if (s.length() > 1) {
String b = "";
for (int i = s.length(); i > 0; i --) {
String c = A06Q3.makePalindrome(s.substring(i,i));
if (i < s.length()) {
int mid = b.length()/2;
b = b.substring(1,mid) + c + b.substring(mid + 1, s.length());
}//if
}//for
return b;
}//if
}