Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   Tech Help (http://zelaron.com/forum/forumdisplay.php?f=329)
-   -   Link Lists... (http://zelaron.com/forum/showthread.php?t=2267)

spa 2002-04-08 06:00 PM

Link Lists...
 
can someone explain to me what the advantages of linked lists are and why you would ever use them?

Thanks

Badass Gandhi 2002-04-08 08:29 PM

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.

WetWired 2002-04-09 12:06 PM

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

Edit: 
pronoun clarification

Badass Gandhi 2002-04-09 12:09 PM

Nah, I think my teacher was thorough enough. I was just trying to mention the basics, that's all.

The stuff you brought up could have been inferred from what I wrote, anyway.

WetWired 2002-04-09 12:12 PM

Actually, I was talking to spa, who appears from his questions to be enrolled in a High School level computer science course of some sort.

It's clear that you know what you're talking about
--WetWired

Badass Gandhi 2002-04-09 12:16 PM

D'oh! :)


All times are GMT -6. The time now is 07:55 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.