Quote:
Originally Posted by friagram
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.
|
what the.... linked lists are wildly used everywhere. in windows kernel too. its the best way to store dynamically allocated variables... linked lists are far superior than reallocating a huge array just to add a single element. also, iterating through a linked list is jsut a few lines:
Code:
LinkedList * element = my_linked_list;
while(element)
{
...
element= element->next;
}
also, what do you mean by convenient lookups? o.O linked lists are not key-value stores... i think you are talking about trees... but then again, tries and binary search trees are efficient, fast and used by every single database server
__________________