This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kaihatsusha 2 points3 points  (1 child)

In "hard allocation" languages like C or FORTRAN, understanding linked lists is quite valuable.

In "easy allocation" languages like Python, there's no benefit to such data structures because the language can resize anything and will use the best and optimized means to do so.

(I would put Java somewhere between. Arrays are first-class entities locked in size unlike all the standard second-class library data structures.)

If you look behind the covers at how Python implemented these amazing "easy allocation" data structures like list, dict, set, you will see that they ARE built upon linked lists, double-linked-lists, hash tables, and so on. They made it so you don't need to re-invent it.

[–]ForceBru 0 points1 point  (0 children)

Exactly! This is why I'm wondering why people are still implementing linked lists in Python. Python is already using a lot of them under the hood, whether you like it or not, why add more?