Description
试写一算法,实现顺序表的就地逆置,即利用原表的存储空间将线性表(a1,a2,…..an),逆置为( an,an-1, …….a2,a1)。
Input
输入长度n
接下来是n个数
Output
操作后的序列。
Sample Input
7
2 4 1 7 5 3 6
Sample Output
6 3 5 7 1 4 2
Description try to write an algorithm to achieve the reverse order of the table place setting, namely the use of the original table storage space will be a linear form (a1, a2, ... .. an), the inverse set of (an, an-1, ... .... a2, a1). Input The input length n followed by n number of Output operation sequence. Sample Input 7 2 4 1 7 5 3 6 Sample Output 6 3 5 7 1 4 2 (2011-10-27, Visual C++, 1KB, 下载5次)