Objective C 中有内置的排序函数吗?

发布于 2024-12-26 22:28:57 字数 65 浏览 1 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

十雾 2025-01-02 22:28:57

苹果没有提供任何有关其排序功能的复杂性的信息,

您应该假设框架将选择排序算法以提供最佳性能,无论如何您可以看一下 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.

浮萍、无处依 2025-01-02 22:28:57

NSArray 有多种排序方法。没有直接记录它们的复杂性,但想必它们是“合理的”。

There are several sort methods of NSArray. There is no direct documentation of their complexity, but presumably they're "reasonable".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文