Binary Tree – Example
•
Create the tree:
BTreeNode<string> node1 = new BTreeNode<string>("3", null, null);
BTreeNode<string> node2 = new BTreeNode<string>("6", null, null);
BTreeNode<string> node3 = new BTreeNode<string>("4", null, null);
BTreeNode<string> node4 = new BTreeNode<string>("1", null, null);
BTreeNode<string> node5 = new BTreeNode<string>("5", null, null);
BTreeNode<string> node6 = new BTreeNode<string>("+", node1, node2);
BTreeNode<string> node7 = new BTreeNode<string>("-", node3, node4);
BTreeNode<string> node8 = new BTreeNode<string>("*", node6, node7);
BTreeNode<string> node9 = new BTreeNode<string>("+", node8, node5);