I have used this code from this website to practice with avl tree, but when i change the first bit from
tree.Add(2);
tree.Add(1);
tree.Add(0);
tree.Add(-1);
tree.Add(-2);
tree.Add(3);
tree.Add(5);
tree.Add(4);
tree.DisplayTree();
to
tree.Add(5);
tree.Add(3);
tree.Add(7);
tree.Add(8);
tree.Delete(3);
tree.DisplayTree();
I get a System.NullReferenceException
error . if I delete 7 instead of 3 I won't get that error . Does anyone know why this happens ?