[Include] Linked lists in PAWN
#21

Quote:
Originally Posted by BigETI
Посмотреть сообщение
It's actually possible to created nested lists. Maybe I should write a tutorial about it... :/
If you're answering that to me, It's not what i meant.
List:
pawn Код:
push(1);
push(2);
push(3);
pop(); // returns 1
pop(); // returns 2
pop(); // returns 3
Stack:
pawn Код:
push(1);
push(2);
push(3);
pop(); // returns 3
pop(); // returns 2
pop(); // returns 1
Reply
#22

Quote:
Originally Posted by wups
Посмотреть сообщение
If you're answering that to me, It's not what i meant.
List:
pawn Код:
push(1);
push(2);
push(3);
pop(); // returns 1
pop(); // returns 2
pop(); // returns 3
Stack:
pawn Код:
push(1);
push(2);
push(3);
pop(); // returns 3
pop(); // returns 2
pop(); // returns 1
I was confused for some seconds. You probably mean the way the data types are removing their nodes/items. A linked list can exactly be used as a stack aswell. You can basicly add a node at the end using LIST::push_back(), and LIST::pop_back() to remove the last created node.

Reply
#23

Nice mate!
Reply
#24

This release is obsolete. I recommend to switch to https://sampforum.blast.hk/showthread.php?tid=645193
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)