Re: Why is indexOfObjectIdenticalTo: *far* faster than indexOfObject: ?
Re: Why is indexOfObjectIdenticalTo: *far* faster than indexOfObject: ?
- Subject: Re: Why is indexOfObjectIdenticalTo: *far* faster than indexOfObject: ?
- From: email@hidden (Heinrich Giesen)
- Date: Thu, 23 Dec 2004 16:27:13 +0100
On 23.12.2004, at 15:02,
Aurélien Hugelé wrote:
IMO indexOfObject is just Olog(n)
no, it is O(n)
because it needs full traversal of
the array
and because of the sequential search it is O(n).
A binary search is O( log(N) ), hashing is something like O(1).
if the searched object is the last one.
No.
The O-Notation is usually not interested in worst case scenarios.
--
Heinrich Giesen
email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden