From the course: Practice It C++: Common Data Structures

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Overview: Linked lists

Overview: Linked lists

(keyboard clicking) - [Instructor] Let's talk about the different type of linear data structure, linked lists. Linked lists store data in nodes connected using pointers. At the beginning of a linked list, we have the head node. The last node of the list is referred to as the tail node. There are two main types of linked lists, singly linked lists and doubly linked lists. In a singly linked list, each node holds a value and the pointer or link to the next node. That allows us to traverse the list one node at a time in a single direction. In contrast, a doubly linked list has two links per node, one pointing to the next node and another pointing to the previous node. Thus, we can traverse the doubly linked list both forward and backward. Both singly and doubly linked lists allow efficient insertion and removal of nodes by simply rearranging pointers. For instance, adding a new node between the second and third node in this…

Contents