rotatearray

Solutions on MaxInterview for rotatearray by the best coders in the world

showing results for - "rotatearray"
Gianluca
30 Feb 2016
1//term for how many time you want array to rotate
2void rotateArray(int arr [],int size,int term){
3    int i=0;
4    while(i<term){
5    int temp=arr[0];
6    for(int j=1;j<size;j++){
7        arr[j-1]=arr[j];
8    }
9    arr[size-1]=temp;
10    i++;
11    }
12}
similar questions
queries leading to this page
rotatearray