algorithms icon indicating copy to clipboard operation
algorithms copied to clipboard

Binary Search Tree Iterator find should return lower bound of found node

Open domfarolino opened this issue 5 years ago • 0 comments

Some cursory research shows that std::multiset::find returns an iterator to the lowest node matching the given key. For example, this means if a tree consists only of one node value, but many duplicates of it, then the find(val) operation will always return an iterator that equals begin().

I don't believe this repository's binary search tree implementation has the same lower-bound find guarantee, but we should check, change our implementation if necessary, and add tests regardless.

domfarolino avatar Feb 02 '20 15:02 domfarolino