Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace JSLTrees
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int[] treeNumbers = new int[] { 15, 8, 22, 6, 55, 12, 19 };
  13.             JSLTree tree = new JSLTree();
  14.             for (int i = 0; i < treeNumbers.Length; i++)
  15.                 tree.Add(treeNumbers[i]);
  16.  
  17.             tree.GetTreeHeight(tree, tree.Root, 0);
  18.             NodePositionInfo rootInfo = new NodePositionInfo(2 ^ (tree.TreeLength - 1), tree.Root.Value.ToString());
  19.             List<List<NodePositionInfo>> list = new List<List<NodePositionInfo>>();
  20.             list[0].Add(rootInfo);
  21.             tree.GetTreeNodePosInfo(tree.Root.Left, list, 0, 0);
  22.             Console.ReadKey();
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement