in reply to Re^2: 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
ow! You transformed a O(N) problem into an O(N2) solution.
firstidx starts at the start of the array every loop pass.
Not only did you half the speed, you doubled the memory requirements.
"firstidx" copies the entire array before processing it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Testing if an array contains a value and then deleting it in most efficient way
by parv (Parson) on Feb 18, 2008 at 16:40 UTC | |
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 |