3 ms·
>Please note that O matters. Even if both algorithms belong to O(n log n) class, algorithm for which O=1 is 100 times faster then algorithm for which O=100. Wa
by flebron 12y ago
>Please note that O matters. Even if both algorithms belong to O(n log n) class, algorithm for which O=1 is 100 times faster then algorithm for which O=100.
Wait, what? O = 100? That's just... not how it works.
- nightcracker 12y agoI think they meant to illustrate that O(100) == O(1), despite a runtime of 100 being a hundred times slower than 1.
- parados 12y agoI think what the author meant was that the elapsed time to sort: t = k * O(f(n)). So given two algorithms that have the same O(f(n)) then the smaller the k, the faster the sort.