Shoot for a constant-time algorithm.