Author Archives: Matt Pulver

Binary Search Revisited

As ubiquitous as it is, the standard binary search algorithm can still be further optimized by using bit operations to iterate through its sorted list, in place of arithmetic. Admittedly, this is primarily an academic discussion, since the code improvement does not decrease the logarithmic complexity of the standard algorithm. Nevertheless, a well-developed programming intuition [...]
Posted in code, programming | Tagged , | 7 Comments

World’s Fastest Binary Search?

(Edited 9 Sept 2011: A few minor improvements have been made; see the updated post instead: Binary Search Revisited.) Every CS student knows how to write a binary search algorithm. The question is, are we really making full use of the fact that we are using a binary computer to do a binary search? While [...]
Posted in programming | 4 Comments

Why Do Cells Have DNA?

In order for a system to reproduce itself, it seems necessary for it to hold an encoded form of itself somehow. This idea, and the inevitability of the existence of DNA-like structures within living cells, is well-illustrated using computer code.
Posted in programming, ruby | Tagged , , , , , , | Leave a comment