Skip to content

Instantly share code, notes, and snippets.

@tautologico
Created June 27, 2011 13:53
Show Gist options
  • Save tautologico/1048893 to your computer and use it in GitHub Desktop.
Save tautologico/1048893 to your computer and use it in GitHub Desktop.
Imprimindo árvores binárias em Prolog
print_tree(void).
print_tree(t(X, void, void)) :- write(X), !.
print_tree(t(X, L, R)) :- write('('), write(X), write(' '), print_tree(L), write(' '), print_tree(R), write(')').
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment