Created
October 31, 2023 15:10
-
-
Save toropanov/669afbc168aec8eab695bee41a728c36 to your computer and use it in GitHub Desktop.
Reverse LinkedList
This file contains hidden or 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
let midEnd = node, prev = null; | |
while (idx <= right) { | |
let next = node.next; | |
node.next = prev; | |
prev = node; | |
node = next; | |
idx++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment