WAP to rotate an array by N.
If arr={5,10,12,16,2,9} and N=2
Then output= {12,16,2,9,5,10} //2 elements are moved out from beginning and are added in the end.
Published By : Suraj Ghimire
WAP to rotate an array by N.
If arr={5,10,12,16,2,9} and N=2
Then output= {12,16,2,9,5,10} //2 elements are moved out from beginning and are added in the end.