Search code examples
mathcomputer-science

Running Time of a d-ary heap?


How is the running time of a d-Ary heap simplified from O(logd n) to O( (log n) / (log d))?

A correct simplification would be: logdn = log d * log n

How is the division simplification derived?


Solution

  • This uses the common identity to convert between logarithmic bases:

    logx(z) = logm(z) / logm(x)

    By multiplying both sides by logm(x), you get:

    logm(z) = logx(z) * logm(x)

    Which is equivalent to the answer in the question you site.

    More information is available here.