aalhour / C-Sharp-Algorithms

:books: :chart_with_upwards_trend: Plug-and-play class-library project of standard Data Structures and Algorithms in C#
MIT License
5.91k stars 1.4k forks source link

Rethinking BST `Find` method signature #173

Open pypkaed opened 11 months ago

pypkaed commented 11 months ago

Describe the bug The Find method in BinarySearchTree throws exceptions. Semantically, 'Find' and 'Get' are two different methods. My suggestion is to return null in case nothing is found in 'Find' and throw exceptions in a new method 'Get'. I understand that there would be a backwards compatibility issue, but the current state really limits the usage of the method and is unintuitive to use.

github-actions[bot] commented 11 months ago

Thanks for supporting the development of C# Algorithms with your first issue! We look forward to handling it.