|
|
|
 |
Posted 2002-04-09, 01:06 PM
in reply to spa's post "Link Lists..."
|
 |
 |
 |
Quote:
Linked lists are more efficient from a memory standpoint. An array allocates a large chunk of data, and any of that space that's not used by the array just sits in memory. In contrast, linked lists allocate the memory they need on the fly, at the expense of a little CPU power.
|
Well actually, for those very reasons, which is more efficient is dependant upon what you're going to do with those lists. If the list size is never going to vary much, and never need to be rearanged, then an array is the way to go, but if the list size is going to vary wildly, or has no upper bound, or if you have a fairly large list that you need to be able to quickly reorder, then a linked list is the way to go.
Sounds like spa's teacher isn't very thorough
--WetWired
Last edited by WetWired; 2002-04-09 at 01:13 PM.
|
 |
 |
 |
|
|
|
|
|
|
|