-4

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 .

Zack ISSOIR
  • 964
  • 11
  • 24
  • 2
    There 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 Answers2

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:

Log(n) scales much better than most algorithms

See What is a plain English explanation of "Big O" notation?

Community
  • 1
  • 1
devoxel
  • 76
  • 1
  • 5