3 ms·
Another cool property about linked lists is that you can add an element to the head of a list without mutating the previous list. There are not many data struct
by waynecochran 4y ago
Another cool property about linked lists is that you can add an element to the head of a list without mutating the previous list. There are not many data structure that you can add an element to and leave the previous version unchanged. This form of immutability is a very nice feature that Lisp / functional programmers enjoy. Because of this, you can concurrently add an element to the head of a list to create new lists without having a critical section in your code.
- robocat 4y ago> you can concurrently add an element to the head of a list to create new lists without having a critical section The race is on: now you have two lists when before you had one?
- rileyphone 4y agoEvery element of the list, from its own point of view, is another list.