Instead of shifting all the list elements up or down, I would prefer to just delete a node an update a pointer.
How big is your list?
I ask for two reasons:
And sometimes, the easy option is good enough. If your list is long enough for the cost of spliceing to become a problem, then you will also be approaching that point at which contructing linked lists from either hashes or arrays starts to consume very large volumes of memory.
Using a heap, or even a string-based list may prove to be fast enough whilst keeping your memory consumption with the range of sanity.
In reply to Re^3: OOP/Linked List Question
by BrowserUk
in thread OOP/Linked List Question
by hok_si_la
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |