Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

binary_search

Fully qualified path: alexandria_searching::binary_search

Free functions

binary_searchPerforms binary search on a sorted span to find the exact position of a target value. Time complexity: O(log n) Space complexity: O(log n) due to recursion…
binary_search_closestPerforms binary search to find the position where a value would be inserted to maintain sorted order, or the closest position to the target value. Time complexity: O(log n)…