This question shows research effort; it is useful and clear
6
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
不久前,我们被分配编写 ac 程序,该程序使用 d-ary max-heap(每个节点最多有 d 个子节点的堆)对包含 n 个数字的数组进行排序。程序需要要求用户输入 d 的值,一个介于 2 和数组大小之间的值。当我检查我的程序时,我不小心输入了 1 作为 d 的值,并且不知何故,该算法成功地使用一元堆正确地对数组进行了排序,尽管它比 d 的正常值花费了更多的时间。