in reply to Shifting an Array
Note that they all take time linear in the size of the array. If you need to do a lot of insertions in a long list, you ought to review your algorithm, and see whether you really need to keep a sorted list. Perhaps a (balanced) tree will be better.splice @a => $idx, 0 => $newitem;
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Shifting an Array
by kelan (Deacon) on Aug 30, 2002 at 13:00 UTC | |
by Abigail-II (Bishop) on Sep 04, 2002 at 09:56 UTC |