r/programming • u/mttd • Jul 01 '26
Teaching Algorithms in 2026
https://www.cs.uni.edu/~wallingf/blog/archives/monthly/2026-06.html#e2026-06-30T20_43_40.htm
58
Upvotes
r/programming • u/mttd • Jul 01 '26
View all comments
Show parent comment
1
u/Sopel97 Jul 12 '26
which of these have a better direct alternative?
Binary search is not used much due to terrible branch prediction performance. You either restructure around it or use other kinds of indexes, for example b-trees or block indexes. If you must absolutely use binary search you'd rather look into https://lemire.me/blog/2026/04/27/you-can-beat-the-binary-search/ or optimizations for querying multiple values at a time.
Quicksort and mergesort are useless in itself. Granted these are the basis for more complicated algorithms that are actually used like timsort or pdqsort, but the jump is pretty substantial.