Files
ladybird/AK
William McPherson d7177212fd AK: Add a BinarySearch template implementation
binary_search takes a haystack, a size, a needle and a compare function.
The compare function should return negative if a < b, positive if a > b
and 0 if a == b. The "sane default" compare function is integral_compare
which implements this with subtraction a - b.
binary_search returns a pointer to a matching element, NOT necessarily
the FIRST matching element. It returns a nullptr if the element was not
found.

This patch includes tests for binary_search.
2019-12-02 15:30:45 +01:00
..
2019-07-31 09:06:39 +02:00
2019-08-07 20:05:36 +02:00
2019-05-28 17:31:20 +02:00
2019-09-22 00:17:29 +02:00
2019-10-28 19:08:48 +01:00
2019-10-28 19:08:48 +01:00
2019-05-28 17:31:20 +02:00
2019-11-25 21:21:27 +01:00
2019-11-07 20:38:33 +01:00