updated tree deletion method

Still not complete but will occasionally delete correctly, seems to have more issues with items near the top of the tree
This commit is contained in:
2022-04-16 22:36:03 +01:00
parent 4b45f5d561
commit e5b0d1659b
2 changed files with 17 additions and 9 deletions

View File

@ -112,17 +112,16 @@ Console.WriteLine("Hello, World!");
Tree<int> tree = new Tree<int>();
tree.Add(4);
tree.Add(5);
tree.Add(7);
tree.Add(6);
tree.Add(2);
tree.Add(4);
tree.Add(3);
tree.Add(2);
tree.Add(1);
tree.Add(8);
tree.Add(7);
tree.Add(0);
var x = tree.Delete(1);
var x = tree.Delete(3);
//tree.Delete(5);
var l = tree.Inorder(null);