Skip to content

Method for search nodes before and after key not found#4

Open
JoaoBaptMG wants to merge 1 commit into
bitlush:masterfrom
JoaoBaptMG:master
Open

Method for search nodes before and after key not found#4
JoaoBaptMG wants to merge 1 commit into
bitlush:masterfrom
JoaoBaptMG:master

Conversation

@JoaoBaptMG

Copy link
Copy Markdown

This method adds something I think is missing from most (if not all) binary search tree implementations on .NET, and is something I needed implemented. SortedDictionary does not have it, neither do SortedSet.

The function added SearchLeftRight, looks for the key requested as usual. However, if it is not found, it returns (in its out parameters) the node values whose keys are immediately before and after the key that was requested, but not found. The specific objective I implemented this method was to be able to search for an angle in an ordered edge list from a vertex, in order to implement a doubly-connected edge list.

…tree (something similar to C++'s lower_bound).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant