Created
July 27, 2021 18:27
-
-
Save code-reaper08/84565bf4f5d0bb78550a6f1c7e0bdcec to your computer and use it in GitHub Desktop.
Rotate function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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