Advertisement
vencinachev

BinaryTreeMain

Sep 8th, 2019
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.             BinTree<int> binTree =
  6.                 new BinTree<int>(14,
  7.                 new BinTree<int>(19,
  8.                 new BinTree<int>(23),
  9.                 new BinTree<int>(6,
  10.                 new BinTree<int>(10),
  11.                 new BinTree<int>(21))),
  12.                 new BinTree<int>(15,
  13.                 new BinTree<int>(3),
  14.                 null));
  15.  
  16.  
  17.             Console.Write("Inorder: ");
  18.             binTree.PrintInorder();
  19.  
  20.             Console.Write("Preorder: ");
  21.             binTree.PrintPreorder();
  22.  
  23.             Console.Write("Postorder: ");
  24.             binTree.PrintPostorder();
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement