Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有一个无序的n整数数组。我想找到 O(n) 中两个元素之间的最短距离。
n
谢谢!
注意:由于时间复杂性,基数排序不适合。
在计算的代数决策树模型中,这是一个 Ω(n log n) 问题。限制为无界整数并没有真正的帮助。