My knowledge of big-O notation is limited , but I read in some posts that algorithms with logarithmic time are fast , can someone explain it please .
Asked
Active
Viewed 121 times
-4
-
2There are many resources on this topic. Have you tried a simple search? https://en.wikipedia.org/wiki/Time_complexity#Logarithmic_time – Michael Petito Nov 08 '15 at 01:02
2 Answers
3
For large N, the percentage of saved operations compared to linear equivalents grows rapidly. As the gradient of a log(N) is proportional to 1/N, for large N O(NlogN) behaves more like O(N) than O(N^2) - for this reason they are often called "linearithmic" or "quasi-linear".
2
To add-on to what willyonka said, here is a graph:
See What is a plain English explanation of "Big O" notation?