using System.Collections;
public Hashtable table = new Hashtable();
public static int element = 0;
public void Inorder(Node root)
table.Add(element, root.data);
public void CreateArray()
int[] array=new int[element];
foreach(var item in table.Keys)
array[count]=Convert.ToInt32(table[item]);
public void Alternamesum(int[] elementarray)
for(int i=0;i<elementarray.Length;i++)
for(int j=i+2;j<elementarray.Length;j=j+2)
Console.WriteLine(maxsum);
public static void Main()
Program tree = new Program();
tree.root.left = new Node(2);
tree.root.right = new Node(3);
tree.root.left.left = new Node(1);
tree.root.right.left = new Node(4);
tree.root.right.right = new Node(5);