© Sammie Bae 2019
Sammie BaeJavaScript Data Structures and Algorithmshttps://doi.org/10.1007/978-1-4842-3988-9_13

13. Linked Lists

Sammie Bae1 
(1)
Hamilton, ON, Canada
 

This chapter will cover linked lists. A linked list is a data structure in which each node points to another node. Unlike arrays, which have a fixed size, a linked list is a dynamic data structure that can allocate and deallocate memory at runtime. By the end of this chapter, you will understand how to implement and work with linked lists.

There are two types of linked lists discussed in this chapter: singly and doubly linked lists. Let’s examine the singly linked list first.

Singly Linked Lists

The linked list data structure is one where each node (element) has reference to the next ...

Get JavaScript Data Structures and Algorithms: An Introduction to Understanding and Implementing Core Data Structure and Algorithm Fundamentals 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.