I need to re-organize an NSMutableArray… for example my array contain the values 1,2,3,4,5.
at the end I need an array with the values (ordering like 5,1,2,3,4).The last value always come first.
How I can do that quickly.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(This runs at O(N). Actually, there is never a way faster than O(N) for an array, although the NSArray may be organized as a deque when the array is small enough where you could get O(1) in the above code. This is an implementation detail one shouldn’t rely on though.)