|
|
|
|
|
by rrrlasse
3959 days ago
|
|
True, but only if the list has more than 2^31 entries on a 32-bit machine. In practise that's not possible if it contains 32-bit integers because that would take up a 16 GB linear address space which doesn't exist on a 32-bit machine. An academically correct version would be `size_t probe = low + ((high - low) / 2);` but that would be much slower. You could instead just add an initial debug-mode-only assert on the list length, for correctness. |
|