logoalt Hacker News

emil-lpyesterday at 9:52 PM0 repliesview on HN

A small tip: if you want to do this trick, with an exponential F, you probably want a linear search rather than a binary search.

If your k << N then F(N/2) is going to eat up all of the running time of ΣF(i).