Created
July 11, 2022 20:25
-
-
Save derrickturk/660795c463b4583e804dfda86a802a40 to your computer and use it in GitHub Desktop.
Stunting on Dumb Twitter Coding Interview guy, in Prolog
This file contains 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
tree(nil). | |
tree([_, Left, Right]) :- tree(Left), tree(Right). | |
revtree(nil, nil). | |
revtree([Data, RLeft, RRight], [Data, Left, Right]) :- | |
revtree(RLeft, Right), | |
revtree(RRight, Left). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment