in reply to Re^3: Testing if an array contains a value and then deleting it in most efficient way
in thread Testing if an array contains a value and then deleting it in most efficient way
How can you avoid O(N^2) cost if using unsorted array? So far there is no indication whether it would be sorted. (Addendum: I wasn't thinking so just quoted the O(N^2) cost, which really should have been O(N). Time to sleep belatedly, I suppose.)
I thought that List::MoreUtils::firstidx would use XS magic (to avoid copying). No? (I would have looked inside the C code myself but am not familiar with XS yet.)
Later ... I see now that array might be already sorted (and first element would be the interesting one).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Testing if an array contains a value and then deleting it in most efficient way
by ikegami (Patriarch) on Feb 18, 2008 at 16:50 UTC | |
by ikegami (Patriarch) on Feb 19, 2008 at 03:59 UTC | |
by parv (Parson) on Feb 19, 2008 at 08:49 UTC |