algorithmruntimebig-oanalysisiterated-logarithm

Meaning of lg * N in Algorithmic Analysis


I'm currently reading about algorithmic analysis and I read that a certain algorithm (weighted quick union with path compression) is of order N + M lg * N. Apparently though this is linear because lg * N is a constant in this universe. What mathematical operation is being referred to here. I am unfamiliar with the notation lg * N.


Solution

  • The answers given here so far are wrong. lg* n (read "log star") is the iterated logarithm. It is defined as recursively as

             0             if n <= 1
    lg* n =
             1 + lg*(lg n) if n > 1 
    

    Another way to think of it is the number of times that you have to iterate logarithm before the result is less than or equal to 1.

    It grows extremely slowly. You can read more on Wikipedia which includes some examples of algorithms for which lg* n pops up in the analysis.