Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sorting large tables



Great suggestion. Thanks.

On Mar 13, 2008, at 5:00 PM, Ben Trumbull wrote:

One nice thing about sorting, is that this is easy to do: merge sort. You can break up the problem as much as you want, and use any handy sort function, and then merge the pieces together.

Algorithms for merging are readily available on the net. Ask google. It's about 1 page of code to use qsort_r() and a hand written merge function.

Merge sort is trivially parallelizable with NSOperationQueue, so you can speed things up more when you're ready to tackle that. It's 1 page of code to allocate, build dependencies, and run a fully concurrent merge sort this way.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >re: sorting large tables (From: Ben Trumbull <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.