Interested in the implementation of a persistent doubly linked list.

On Wikipedia I found a formal description of the method, which consists in combining the methods of copying the path and the "thick" nodes. But I’m not entirely clear how to write this effectively in a programming language. It also raises the question of what functions will be available in this implementation.

I would be interested in a list with the functions pop_front () and pop_back ().

Could someone give recommendations on how to implement or even better - sample code in any programming language.

    1 answer 1

    What is the problem to implement this using the algorithms that git uses, namely, to create a queue and in it to store an object describing what has changed in the list and how to go back. This data structure easily restores the previous value and is easily updated to the form where you can freely switch from one version to another.