From the course: Master C Language Pointers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating a double-linked list

Creating a double-linked list - C Tutorial

From the course: Master C Language Pointers

Start my 1-month free trial

Creating a double-linked list

- [Instructor] Variation on the linked list concept is the Double Linked List, in this approach each structure contains two pointer members. A forward reference and a backward reference. This additional pointer member allows you to move forward and backward in the list, where as a single linked list requires the action always move front to back. Further a last pointer is required, which serves the same function as the first pointer, but from the other end of the list. A Double Linked List requires more overhead, but it's easier to navigate as the code can move back and forth through the list as opposed to moving in one direction only. Behold my implementation of a Double Linked List as shown in this exercise file. The structure definition shown at line nine, has two pointer members, next and previous. These members link the structure to it's neighbors in the list. The list itself is built in the main function in the…

Contents