private void subAVl(Binary_Tree.NodeAVL avl) { if (avl == null) { return; } string x = string.Format("Key:{0} Count:{1}", avl.Key, avl.Kvo); avl_treeView.Nodes.Add(x, x); if (avl.Left != null) { sub(avl.Left, ref avl_treeView, x); } if (avl.Right != null) { sub(avl.Right, ref avl_treeView, x); } }
private void sub(Binary_Tree.NodeAVL avl_node, ref TreeView nodeTV, string x) { string x2 = string.Format("Key:{0} Count:{1}", avl_node.Key, avl_node.Kvo); TreeNode[] newN = nodeTV.Nodes.Find(x, true); newN[0].Nodes.Add(new TreeNode { Name = x2, Text = x2 }); if (avl_node.Left != null) { sub(avl_node.Left, ref nodeTV, x2); } if (avl_node.Right != null) { sub(avl_node.Right, ref nodeTV, x2); } }