traverse(null, []).
traverse(tree(Root, Left, Right), SortedList) :-
      traverse(Left, SortedListLeft),
      traverse(Right, SortedListRight),
      append(SortedListLeft,
             [Root | SortedListRight],
             SortedList).


