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.