Is there a built-in sort function in Objective-C?

Is there a built-in sort function in Objective-C with O (n log n) complexity?

+4
source share
2 answers

Apple does not provide any information about the complexity of its sorting functions,

You should proceed from the fact that the sorting algorithm will be selected by the structure to provide better performance, in any case, you can take a look at CHDataStructures if you need additional data structures to implement the sorting algorithm as you see fit, possibly a bunch or a binary tree.

+1
source

There are several NSArray sorting methods. There is no direct documentation on their complexity, but, apparently, they are "reasonable."

0
source

Source: https://habr.com/ru/post/1391186/


All Articles