aalhour / aalhour/C-Sharp-Algorithms

Rethinking BST `Find` method signature

Offen
#173 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
6.2k
Forks
1.4k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.