4

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

2

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.