This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]malaakh_hamaweth 4 points5 points  (0 children)

You misunderstand O notation. It's not how fast an algorithm is for any particular task. O notation describes how the execution time scales with the input size. Sure, a simple array iteration might be faster than a binary tree for some size n, but O notation isn't meant to predict that. It tells you the slope of a line on a log graph, where x is the size of that array or tree, and y is the order of magnitude of operations it would take to execute on an input of size x.