Skip to content

Instantly share code, notes, and snippets.

@code-reaper08
Created July 27, 2021 18:27
Show Gist options
  • Save code-reaper08/84565bf4f5d0bb78550a6f1c7e0bdcec to your computer and use it in GitHub Desktop.
Save code-reaper08/84565bf4f5d0bb78550a6f1c7e0bdcec to your computer and use it in GitHub Desktop.
Rotate function
function Rotate(samparr, d, n) {
if (d == 0) {
return;
}
Reverse(samparr, 0, d - 1);
Reverse(samparr, d, n - 1);
Reverse(samparr, 0, n - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment