You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an alternative to the current reverse x 3 approach that is also in place and O(n). This alternative might be more memory access friendly as it only loops on the array once in forward order.
// rotate left versionletrotate=function(a,i,j,k){if(k<=0)return;while((i+=k)+k<j)swapranges(a,i-k,i,a,i);swapranges(a,i,j,a,i-k);rotate(a,j-k,j,k-(j-i));// tail recursion}
The text was updated successfully, but these errors were encountered:
There is an alternative to the current reverse x 3 approach that is also in place and O(n). This alternative might be more memory access friendly as it only loops on the array once in forward order.
The text was updated successfully, but these errors were encountered: