王道数据结构2.2.3——10、数组中的n个数的序列循环左移p个位置

思路

和8题一样的解法

代码

void reverse(ElemType &A[],int first,int last){
    int temp;
    while(first

分析

时间复杂度为O(n),空间复杂度为O(1)

你可能感兴趣的:(王道数据结构)