From the course: Programming Foundations: Algorithms

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Linked lists

Linked lists

- [Instructor] Let's take a look at a data structure called a linked list. A linked list is a linear collection of data, and it contains elements which are sometimes called nodes. Each of these nodes has a member field that points to the next element in the list. Each of these elements can contain whatever information your app needs to work with. Conceptually, a linked list looks like this. And in this case, the nodes contain integer numbers, but they can contain any data. The first item in the list is called the head element, and each element also has a field that refers to the next element in the list. The last item in the list has a field that points to nothing, which indicates that it is the end of the list. In this particular case, the diagram you see here represents what's called a singly linked list. It's called that because there's only one direction of links provided. That is each item only knows about its next…

Contents