Like array and linked list, the unrolled Linked List is also a linear data structure and is a variant of a linked list. Unlike a simple linked list, it stores multiple elements at each node. That is, instead of storing a single element at a node, unrolled linked lists store an array of elements at a node. The unrolled linked list covers the advantages of both array and linked list as it reduces the memory overhead in comparison to simple linked lists by storing multiple elements at each node and it also has the advantage of fast insertion and deletion as that of a linked list.
- Because of the Cache behavior, linear search is much faster in unrolled linked lists.
- In comparison to the ordinary linked list, it requires less storage space for pointers/references.
- It performs operations like insertion, deletion, and traversal more quickly than ordinary linked lists (because search is faster).
- The overhead per node is comparatively high than singly-linked lists. Refer to an example node in the below code.
The below program creates a simple unrolled linked list with 3 nodes containing a variable number of elements in each. It also traverses the created list.
1 2 3 4 5 6 7 8 9
In this article, we have introduced an unrolled list and advantages of it. We have also shown how to traverse the list. In the next article, we will be discussing the insertion, deletion, and values of maxElements/numElements in detail.
Insertion in Unrolled Linked List
This article is contributed by Harsh Agarwal. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Insertion in Unrolled Linked List
- XOR Linked List - A Memory Efficient Doubly Linked List | Set 1
- XOR Linked List – A Memory Efficient Doubly Linked List | Set 2
- Merge a linked list into another linked list at alternate positions
- Convert singly linked list into circular linked list
- Difference between Singly linked list and Doubly linked list
- Convert Singly Linked List to XOR Linked List
- Create new linked list from two given linked list with greater element at each node
- Check if a linked list is Circular Linked List
- Generate Linked List consisting of maximum difference of squares of pairs of nodes from given Linked List
- Doubly Circular Linked List | Set 1 (Introduction and Insertion)
- Linked List | Set 1 (Introduction)
- Doubly Linked List | Set 1 (Introduction and Insertion)
- Circular Linked List | Set 1 (Introduction and Applications)
- Construct a Maximum Sum Linked List out of two Sorted Linked Lists having some Common nodes
- Create a linked list from two linked lists by choosing max element at each position
- Construct a Doubly linked linked list from 2D Matrix
- Sublist Search (Search a linked list in another list)
- Length of longest palindrome list in a linked list using O(1) extra space
- Partitioning a linked list around a given value and If we don't care about making the elements of the list "stable"