aalhour / aalhour/C-Sharp-Algorithms

Rethinking BST `Find` method signature

Open
#173 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
6.2k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.