Can someone tell me what the point of linked lists are?
I've been writing software professionally for almost seven years now and I've never written a single program that needed anything close to that data structure.
So is it just pointless bullshit to sell to comp sci students? Also, same question for binary trees.
It was taught back in the C days before standarized dynamic containers, it's still taught more as a "here's how that shit works under the hood" thin
Brayden Ross
you only use the exact amount of space that you need easy to change size it's just convenient if you don't have a "list" type like in Python doing all the dynamic array magic under the hood.
Ayden Stewart
do research; they're basically the heap version of a mutable array
Noah Gonzalez
>same question for binary trees.
you're a webdev aren't you?
Joshua Russell
Okay so as a person who mostly sticks to Python and Javascript that holds my hand for everything / has garbage collection I can ignore this?
I have an interview soon and I'll be pissed if they ask me about linked lists. The last time I read about them was probably in a C++ book
Logan Robinson
linked lists do not take up a contiguous part of memory meaning that restructuring a linked list is a considerably less expensive operation where as with an array thats a really expensive operation since you gotta reallocate all that shit and copy it and ghghughhghhhhhhhhh
it might have mattered more back in the day but the differences between the two are rather miniscule unless you are working with just huge bad boys of memory and linked lists are taught more to ease students into thinking about pointers and big O and stuff like that
if u dont know what the point of binary trees are then u r lost...
there is slightly more overhead to using a linked list since u gotta store a pointer along with the data as opposed to how in an array its just the data
So you're saying that I would use something resembling a linked list if I wanted to be able to support delete / new / insert because a regular array is contiguously allocated?
Man its been too long since I thought about this shit
Xavier Thompson
just retire grandpa, you're not cut for this anymore