Objective C 中有内置的排序函数吗?
Objective C 中是否有内置的 sort
函数,其复杂度为 O(n log n)?
Is there any built in sort
function in Objective C with complexity of O(n log n)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
苹果没有提供任何有关其排序功能的复杂性的信息,
您应该假设框架将选择排序算法以提供最佳性能,无论如何您可以看一下 CHDataStructures 如果您需要额外的数据结构来自行实现排序算法,可能是堆排序或二叉树排序。
Apple doesn't provide any kind of information about the complexity on his sorting functions,
You should asume that the sorting algorithm will be chosen by the framework to give the best performance, in any case you can take a look at CHDataStructures if you need extra data structures to implement the sorting algorithm on your own, probably a heap or a binary tree sort.
NSArray 有多种排序方法。没有直接记录它们的复杂性,但想必它们是“合理的”。
There are several sort methods of NSArray. There is no direct documentation of their complexity, but presumably they're "reasonable".