ignl / BinarySearchTrees

Java binary search trees implementations and tests: AVL Tree, Red black tree, Scapegoat tree, Splay tree, Treap
Apache License 2.0
128 stars 49 forks source link

AVL delete too many break statements #2

Open dmcmanam opened 7 years ago

dmcmanam commented 7 years ago

Great idea trying to re-use the same rebalancing code in the AVL delete algorithm but it will not correctly handle Fibonacci trees although this is probably very rare in practice. The AVL delete conditions are described here (there are two additional cases to handle compared to insert): http://adtinfo.org/libavl.html/Deleting-an-AVL-Node-Step-3-_002d-Update.html

ignl commented 6 years ago

This might be useful for others who are looking to implement AVL trees thanks for pointing it out, I was not aware of that.