Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. static void InfixPrintln(TreeNode<int> tree, bool f = true)
  2. {
  3. if (tree == null)
  4. {
  5. Console.WriteLine("<empty line>");
  6. return;
  7. }
  8. if (tree.left != null)
  9. InfixPrintln(tree.left, false);
  10. Console.Write(tree.data + " ");
  11. if (tree.right != null)
  12. InfixPrintln(tree.right, f);
  13. else if (f)
  14. Console.WriteLine();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement