Meaning of lg * N in Algorithmic Analysis

前端 未结 6 1894
暖寄归人
暖寄归人 2021-02-05 05:23

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 th

6条回答
  •  死守一世寂寞
    2021-02-05 06:14

    I'm assuming you're talking about the algorithm analyzed on slide 44 of this lecture: http://www.cs.princeton.edu/courses/archive/fall05/cos226/lectures/union-find.pdf

    Where they say "lg * N is a constant in this universe" I believe they aren't being entirely literal. lg*N does appear to increase with N as per their table on the right side of the slide; it just happens to grow at such a slow rate that it can't be considered much else (N = 2^65536 -> log*n = 5). As such it seems they're saying that you can just ignore the log*N as a constant because it will never increase enough to cause a problem.

    I could be wrong, though. That's simply how I read it.

    edit: it might help to note that for this equation they're defining "lg*N" to be 2^(lg*(N-1)). Meaning that an N value of 2^(2^(65536)) [a far larger number] would give lg*N = 6, for example.

提交回复
热议问题