[Tutorial] Linked lists
#4

Quite a good tut for the include you made.
This is an easier definition for those who do not understand what this is:

* This is almost like an infinitely long array which are possible in some languages but not in 'static' languages like PAWN.
* These have two parts - one part stores the VALUE for that index and the other part stores the ADDRESS to the next index. (node)
* The only differences between arrays and linked lists are that array cells are arranged one by one while linked lists' cells are not - the second difference is that linked lists are practically infinite
* It's very awesome for things like situations like:
pawn Код:
new object_INFO[ MAX_OBJECTS ][ CURRENT_PLAYERS ] ;

CURRENT_PLAYERS = ?
In such large arrays each added index adds a lot of memory, so you can create CURRENT_PLAYERS linked lists and then do stuff like this.

Make sure you know what the hell you're doing else you can mess up with memory.

@ Sublime - PAWN is quite high level considering languages like ASM85
Reply


Messages In This Thread
Linked lists - by BigETI - 26.11.2013, 14:36
Re: Linked lists - by Sublime - 26.11.2013, 14:44
AW: Re: Linked lists - by BigETI - 26.11.2013, 14:59
Re: Linked lists - by RajatPawar - 26.11.2013, 15:08

Forum Jump:


Users browsing this thread: 1 Guest(s)