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.
这是一个典型的问题,需要您一次性解决。给定一个仅包含 0、1 和 2 的数组。您需要在 O(1) 辅助空间中一次性对数组进行排序。我想知道对于包含更多不同值的数组是否存在这样的单程解决方案,以及单程解决方案存在的不同值的数量的限制是什么。