public static void reverse_in_place(String[] array)
时间: 2024-06-06 20:07:24 浏览: 51
Takes a string and reverses it.
{
int i = 0;
int j = array.length - 1;
while (i < j) {
String temp = array[i];
array[i] = array[j];
array[j] = temp;
i++;
j--;
}
}
阅读全文