On 1/7/10 1:44 PM, David Duncan said: >> To help make this thread more Cocoa-y, I would like to ask: Do the >NSSet and NSArray methods like -containsObject perform in a fashion >comparable to a home-rolled binary search? I greatly prefer to use the >Cocoa stuff rather than try to remember/learn how to properly code such >things. > >Since NSArray is unordered I would not expect its containsObject to do >better than O(n). If NSSet is an ordered container, it should be able to >do O(lg n). I don't believe we give any guarantees as to performance of >these methods however, but a simple implementation of either data >structure would likely give you these performance characteristics.
CFArray.h does discuss performance. And there exists a CFArrayBSearchValues(). -- ____________________________________________________________ Sean McBride, B. Eng s...@rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montréal, Québec, Canada _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/archive%40mail-archive.com This email sent to arch...@mail-archive.com