"Linked list"
Ciao,
what do you think about "linked list" made via dynamic array of datapacks (every cell of array contains handle to datapack)? Is that a good idea? I know about array of enums, but that is not dynamic.. And if I make some stocks for that solution it would be an awesome thing I guess. |
Re: "Linked list"
Probably, there is a better way to do what you want to do.
But you can use adt array for that. Or even adt stack or global databack whichever fits you better. |
Re: "Linked list"
I meant somthing like this
PHP Code:
PHP Code:
|
Re: "Linked list"
Linklists are cancer
Iono why they even teach them in programming classes. Just like data structures theory. Unless it is for a very specific application that requires re-use of the handles for convenient storage and lookup, it's a complete waste, which almost always is the case. They are also really hard to iterate through. |
Re: "Linked list"
Have you ever though about array of enum of adt array :3
A similar solution (that i've just posted for someone else) may interest you: https://forums.alliedmods.net/showpo...7&postcount=17 https://forums.alliedmods.net/showpo...9&postcount=20 |
Re: "Linked list"
Quote:
Code:
LinkedList * element = my_linked_list; |
Re: "Linked list"
In addition to what Zephyrus said, depending on the implementation linked lists can be iterated in both directions (right->left or left->right).
|
Re: "Linked list"
Perhaps sl, but linked lists in c are much different than sourcepawn implementations...
|
Re: "Linked list"
Quote:
Linked lists have their uses, but ease of lookups isn't one of them... from any position in a linked list, you only know what the next element is (and previous element for doubly linked lists). In other words, you're not likely to run into too many cases where they're actually useful for SourcePawn. |
Re: "Linked list"
Thx guys for your opinions! You helped me ;-)
|
All times are GMT -4. The time now is 10:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.