Mail Archives: djgpp/1998/03/30/07:30:23
Nils Emil P. Larsen wrote in message
<3 DOT 0 DOT 5 DOT 32 DOT 19980329185251 DOT 007a4430 AT vip DOT cybercity DOT dk>...
>Hi!
>
>Can anyone show me (or tell me where to find) a good example of practical
>using of linked lists? I really don't understand what they a for, but I
>think they are important!
>
>Thank you very much!
>Nils Emil P. Larsen
It's my interpretation that linked lists are good for storing dynamic data.
This is to say instead of creating an array of size 50 and maybe only using
its full storage capacity for a few seconds, use a linked list.
As you add items to the list, new nodes (boxes to hold your data) are
created (allocated from memory).
This approach wastes a lot less memory.
I know this isn't rec.games.programmer but I'm going to use linked lists to
hold the units created so far, in my game.
It may be wise to check out a book on data structures,
alialx - "all life is a learning experience"
Jeff
- Raw text -