Skip navigation.
 
mlRe: Why is indexOfObjectIdenticalTo: *far* faster than indexOfObject: ?
FROM : Aurélien Hugelé
DATE : Thu Dec 23 18:13:31 2004

On 23 déc. 04, at 16:27, Heinrich Giesen wrote:

>
> On 23.12.2004, at 15:02, Aurélien Hugelé wrote:
>

>> IMO indexOfObject is just Olog(n)

> no, it is O(n)


yes it is my mistake ;)

>> 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).


you are right again

>

>> if the searched object is the last one.

> No.
> The O-Notation is usually not interested in worst case scenarios.
>


i did not know that :) i thought we should always think about the worst
case scenario !


> Heinrich Giesen
> email: <email_removed>
>
>

Related mailsAuthorDate
mlRe: Why is indexOfObjectIdenticalTo: *far* faster than indexOfObject: ? heinrich.giesen Dec 23, 16:27
mlRe: Why is indexOfObjectIdenticalTo: *far* faster than indexOfObject: ? Aurélien Hugelé Dec 23, 18:13
mlRe: Why is indexOfObjectIdenticalTo: *far* faster than indexOfObject: ? Robbie Haertel Dec 23, 18:30