(1)n个辅助空间的情况下:
1.栈
2.另辟n个大小的数组
(2)就地倒置
for (i=0; i<=length/2; i++ )
{
temp=a[i];
a[i]=a[length-i];
a[length-i] =temp;
}
(3)效率最高的使用指针 *Pstart , *Pend;
(1)n个辅助空间的情况下:
1.栈
2.另辟n个大小的数组
(2)就地倒置
for (i=0; i<=length/2; i++ )
{
temp=a[i];
a[i]=a[length-i];
a[length-i] =temp;
}
(3)效率最高的使用指针 *Pstart , *Pend;