admin@onlinelearningcenter.in (+91) 7 999 01 02 03

Rotate an Array

Suraj Ghimire
42 Posts

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
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Jquery Comments Plugin