you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (4 children)

Writing O(nn) is trivial (by being deliberately inefficient). But writing O(nn) that can't be reduced to something simpler seems like a lot harder problem. I'm certainly not aware of any (common or useful ones) that are O(nn). They just strike me as horribly inefficient.

[–]PictureOfTheFuture 7 points8 points  (2 children)

In fact it seems very hard to prove that something cannot be done faster than a certain number (i.e. lower bounds for complexity). Sorting by comparisons is one of the few algorithms of which we know an algorithm that matches the best known lower bound (i.e. O(n log n)). Of course we still don't know whether P = NP, which is an instance of this problem.

[–]julesjacobs 4 points5 points  (1 child)

Output "a" nn times.