Last active
October 20, 2020 04:36
-
-
Save pervognsen/bf5293d9588809c2ec181dcd0d017bb4 to your computer and use it in GitHub Desktop.
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
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