- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
谁能给我一个直观的解释为什么阿克曼函数 http://en.wikipedia.org/wiki/Ackermann_function与用于不相交集的并查找算法的摊销复杂度有关 http://en.wikipedia.org/wiki/Disjoint-set_data_structure ?
Tarjan 的数据结构书中的分析不是很直观。
我也在《算法导论》中查过,但似乎也太严格且不直观。
感谢您的帮助!
最佳答案
来自 Wikipedia
(about find and union) These two techniques complement each other; applied together, the amortized time per operation is only O(α(n)), where α(n) is the inverse of the function f(n) = A(n,n), and A is the extremely quickly-growing Ackermann function. Since α(n) is the inverse of this function, α(n) is less than 5 for all remotely practical values of n. Thus, the amortized running time per operation is effectively a small constant.
The Function lg*n
Note that lg*n is a very slow growing function, much slower than lg n. In fact is slower than lg lg n, or any finite composition of lg n. It is the inverse of the function f(n) = 2 ^2^2^…^2, n times. For n >= 5, f(n) is greater than the number of atoms in the universe. Hence for all intents and purposes, the inverse of f(n) for any real life value of n, is constant. From an engineer’s point of view, Kruskal’s algorithm runs in O(e). Note of course that from a theoretician’s point of view, a true result of O(e) would still be a significant breakthrough. The whole picture is not complete because the actual best result shows that lg*n can be replaced by the inverse of A(p,n) where A is Ackermann’s function, a function that grows explosively. The inverse of Ackermann’s function is related to lg*n, and is a nicer result, but the proof is even harder.
关于set - 为什么阿克曼函数与用于不相交集的并查找算法的摊余复杂度相关?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6342967/
我看过这个thread (以及许多其他人)但我仍然无法在 python 中检索参数。 1)有了这个... Run Cmd \k "Python C:\my.py %myvar%" ... Cmd 已
如果以下 SPARQL 查询有问题: PREFIX rdf: PREFIX owl: PREFIX xsd: PREFIX rdfs: PREFIX : SELECT ?ModuleName
我是一名优秀的程序员,十分优秀!