Variety of linked lists
A linked list is a classical data structure that can be used as data storage for different algorithms and efficient memory management. Usually, for the tasks that Lua programming language solves, linked lists are rarely used. In most cases stack and queue are enough, but for some tasks linked lists are irreplaceable.
Here are some variations of linked lists with links to implementation in Lua.
- Singly linked list – the most simple linked list where nodes are connected linearly and sequentially, where a node has its value and points to the next node.
- Circular singly linked list – same as the linear singly linked list, but nodes are connected in a continuous circular manner.
- Doubly linked list – linked list with two pointers: one for the next node and the other for the previous.
- Circular doubly linked list – same as the doubly linked list with two pointers to the next and previous node connected in a continuous circular manner.
Advanced¶
There are much more advanced variations of linked lists, which are rarely used and almost never in interpreted languages like Lua. These are meant for working and optimizing work with memory on a lower level. Maybe someday I will also implement them as examples for Lua language.
- XOR linked list
- Asymmetric linked list
- Sparse linked lists
- In-memory linked list
- Intrusive linked list
- More…
Feedback
For feedback, please check the contacts section. Before writing, please specify where you came from and who you are. Sometimes spammers go insane. Thank you in advance for your understanding.