Well, depends on what you mean by ordered. NSArray retains insertion order.
NSSet does not. But NSSet may be sorting things on insertion (like you'd get
with a binary tree structure), while NSArray cannot assume any particular
order. So from the NSArray implementor's standpoint, the array is unordered.

-BJ

On Thu, Jan 7, 2010 at 2:52 PM, Dave DeLong <davedel...@me.com> wrote:

> That's backwards.  NSArray is ordered; NSSet is not.
>
> Dave
>
> On Jan 7, 2010, at 2:44 PM, David Duncan wrote:
>
> > 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).
>
> _______________________________________________
>
> 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/bjhomer%40gmail.com
>
> This email sent to bjho...@gmail.com
>
_______________________________________________

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

Reply via email to