GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Placement Papers  >  Adobe  >  Placement Papers

 Print  |  
Question:  rotate an array using reverse fn....

Ans....use reverse 3 times




October 10, 2006 13:41:34 #2
 hari   Member Since: Visitor    Total Comments: N/A 

RE: rotate an array using reverse fn....An...
 
this works by double reversal principle to rotate an array by 3 postions ... first reverse the first 3 elements from the list and then reverse the remaining elements from the list in place and then reverse the entire array the result is that we have an array that is rotated by 3 postions
     

 

Back To Question