【发布时间】:2017-08-10 04:58:52
【问题描述】:
谁能告诉我*https://en.wikipedia.org/wiki/Heap%27s_algorithm中显示的这个堆算法的时间复杂度到底是多少?
我搜索了几个网站,答案都很模糊,有些人说时间复杂度是 O(N!),有些人说是 O(NlogN)。哪一个是正确答案?为什么?
谢谢。
【问题讨论】:
标签: algorithm data-structures time-complexity permutation heaps-algorithm