Abstract

The singly linked list structure is a useful data structure for storing and accessing dynamic lists. Unfortunately, the singly linked structure has its shortcomings as one can only access a list in one direction—forward. Once one member of a list is located, it is not easy to access its previous neighbor. The chapter also discusses other data structures, including an alternative to the singly linked list—the doubly linked list. The doubly linked list is an extension of the singly linked list. With doubly linked lists, one can easily traverse both forwards and backwards. This provides one with much more flexibility for performing operations such as sorting lists or deleting elements. Doubly linked lists are often used in programs such as editors where it is necessary to be able to move quickly in more than one direction. To sort a list, a technique based on the selection sort method is used. The algorithm consists of first locating the smallest element in the list and moving this element to the head of the list.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.