4 ms·
Ask HN: What do you use linked lists and doubly linked lists for?
- eggsAndBacon 7y agoOpen your book/laptop and just do your homework.
- TheAsprngHacker 7y agoSingly linked lists are heavily used in functional programming, and Lisp is famous for them. The reason why singly linked lists are so neat is that they are an inductive datatype that describes a sequence: A list is either empty or an element followed by a list.
- anigbrowl 7y agoCollections of things that you don't know the quantity of ahead of time.
- TheAsprngHacker 7y agoDynamic arrays can be more appropriate than linked lists, depending on the context. Because dynamic arrays multiply the buffer size by a certain factor upon every reallocation, growth of the array is amortized O(1). In addition, dynamic arrays get the benefit of the cache because the elements are contiguous.
- simonblack 7y agoThreaded Interpretive Languages?