0

If Log n is written what is its base 10 or 2 in algorithm

yadav
  • 1
  • 2
  • question does not make sense. log N complexity means log N complexity. it means that as N increases, the complexity increases as log N, or put another way if N increases exponentially, then the complexity increases linearally. – Mitch Wheat Dec 12 '21 at 03:27
  • `log n` usually means the natural logarithm, i.e. base `e`. If you find that in an expression like `O(log n)`, the base does not actually matter because a different base would just mean a multiple by a constant. – Henry Dec 12 '21 at 05:17
  • 2
    Please edit the question to clarify it. There are some contexts where we write "log(n)" without specifying the base because we assume the base is obvious from context - mathematicians always use natural logarithm, chemists always use decimal logarithm, computer scientists always use binary logarithm. And then inside a big-O notation, O(log(n)), we don't specify the base because the base actually doesn't matter: O(log2(n)) == O(log10(n)) – Stef Dec 12 '21 at 12:09
  • 2
    Or maybe don't edit the question, because @Stef already answered it above, and there are plenty of other answers to it on SO – Matt Timmermans Dec 12 '21 at 15:15

0 Answers0