kanwei / algorithms

Ruby algorithms and data structures. C extensions
http://kanwei.github.io/algorithms/
MIT License
2.67k stars 352 forks source link

Check if key exists before deleting it #55

Open GarrisonJ opened 10 months ago

GarrisonJ commented 10 months ago

This fixes https://github.com/kanwei/algorithms/issues/51

This issue existed for both the C and Ruby version of the Red-Black tree.

It's important to check if the element exists before deleting an element from a Red-Black tree.