Skip to content

Instantly share code, notes, and snippets.

@pervognsen
Last active October 20, 2020 04:36
Show Gist options
  • Save pervognsen/bf5293d9588809c2ec181dcd0d017bb4 to your computer and use it in GitHub Desktop.
Save pervognsen/bf5293d9588809c2ec181dcd0d017bb4 to your computer and use it in GitHub Desktop.
func bisect(begin: Node*, end: Node*): Node*
return nth(begin, end, len(begin, end) / 2)
func print_reverse(begin: Node*, end: Node*)
if begin == end
return
mid := bisect(begin, end)
if mid != end
print_reverse(next(mid), end)
print_node(mid)
print_reverse(begin, mid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment