129. Introducing the Unrolled Linked List data structure
An Unrolled Linked List is a flavor of a linked list that stores arrays (multiple items). Each node of an Unrolled Linked List can store an array. It is like combining the powers of an array with those of a linked list. In other words, an Unrolled Linked List is a data structure with a low memory footprint and high performance on insertion and deletion.
Insertion and deletion from an Unrolled Linked List have different implementations.
For instance, we can insert arrays (insert(int[] arr)
), which means that for each insertion, we create a new node and insert that array into it.
Deleting an item is equivalent to removing the item from the specified index in the proper array. If, after deletion, the array is empty, then it is removed from the list as well.
Another approach assumes that the Unrolled Linked List has a fixed capacity (each node holds an array of this capacity). Further, we insert items one by one...