Skip to content

Instantly share code, notes, and snippets.

@toropanov
Created October 31, 2023 15:10
Show Gist options
  • Save toropanov/669afbc168aec8eab695bee41a728c36 to your computer and use it in GitHub Desktop.
Save toropanov/669afbc168aec8eab695bee41a728c36 to your computer and use it in GitHub Desktop.
Reverse LinkedList
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