Original Post
Once I read an interesting question. Given: - a problem size n - an algorithm with a certain time complexity O(f(n)) - a certain time a processor needs to solve the problem Question: If you upgrade to a processor twice as fast, how can the problem size grow so you can still solve the new, larger problem in the same time? For O(n), the answer is obviously 2n. If you could previously search for an element in an unordered array of size 1000, now you can search in a 2000 element array in the same time. For O(log n), the answer seems to be 4n (binary base 2 to the power of the speedfactor 2). A binary search tree twice as deep is four times as large. For O(1), you can't really tell, because the problem size doesn't influence the time complexity. Answers that seem to make sense are infinity and 1. For O(n^2), I'm pretty sure it's 1.41n, because 1.41^2 = 2. The one complexity class I cannot solve is O(n log n). It has to be something between 1.41n and 2n, and some simple numeric tests with OpenOffice Calc seem to indicate ~1.7n. But how exactly do I get to that factor? I tried (m log m)/(n log n) = 2 and then solve for m, but I got stuck.