Commit 1dbae4a
authored
Add test case for binary_search with duplicates
This adds a doctest example showing that binary_search correctly handles lists with duplicate elements.
Fixes #13886
The binary search algorithm correctly returns one valid index of the target element, even when there are duplicates in the sorted list.1 parent a051ab5 commit 1dbae4a
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
0 commit comments