© Elshad Karimov 2020
E. KarimovData Structures and Algorithms in Swifthttps://doi.org/10.1007/978-1-4842-5769-2_6

6. Linked Lists

Elshad Karimov1 
(1)
New York, New York, USA
 
A linked list is a data structure that holds a group of data items which represents a sequence. Here each data item is referred to as a node. The nodes contain data and are interconnected to the next node in the sequence via their links. More complex forms of the list add additional links. The main advantage of a linked list is quick insertion and deletion. The linked list is a linear data structure like arrays, but unlike arrays, elements are not stored in a contiguous location. Like arrays, a linked list is a linear data structure (Figure 6-1).
Figure 6-1

Linear data structure ...

Get Data Structures and Algorithms in Swift: Implement Stacks, Queues, Dictionaries, and Lists in Your Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.