Skip to content

Instantly share code, notes, and snippets.

@kevinahn7
Last active January 14, 2019 01:24
Show Gist options
  • Select an option

  • Save kevinahn7/6d62f26348bcf438d2547a72a52e5344 to your computer and use it in GitHub Desktop.

Select an option

Save kevinahn7/6d62f26348bcf438d2547a72a52e5344 to your computer and use it in GitHub Desktop.
function reverse(node) {
if (node === null) {
return;
} else {
reverse(node.left);
reverse(node.right(;
}
let temp = node.left;
node.left = node.right;
node.right = temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment