• + 1 comment

    how did u find the new position? for my case i just simply do a modular operation:

    int new_start_pos = r%ptr;
    

    if you actually do actual N rotations (on the linear array) then I think it will still take long time.