Discover the difference between singly linked and doubly linked lists. Learn how we can turn a singly linked list into a doubly linked list in order to make our data more accessible.
- So far, we've been dealing with linked lists…that have nodes with a piece of data and a next pointer.…We call these singly linked lists,…because they only have a pointer pointing…to the next node in the list.…With only a next pointer, you can only traverse…forward through a list.…You cannot go backwards.…However, we can fix this by adding a previous pointer…to each of our nodes.…Now, each node of the linked list…will contain a piece of data, a next pointer,…as well as a previous pointer.…
We call this a doubly linked list,…because we have a next and previous pointer…and we can go through the list forward or backward.…In Java, if we implement a doubly linked list from scratch,…we just need to add a previous pointer to our node blueprint…and a tail node to our linked list as a whole.…By modifying each node within the linked list…to have a previous pointer or previous node,…we can change a linked list from singly to doubly linked.…
- Data types: Booleans, numbers, strings, and more
- Multidimensional arrays
- Jagged arrays
- Search and sort arrays
- Linked lists
- Stacks and queues
- Hash functions and hash tables
- Trees and graphs
Skill Level Intermediate
Understand data structures1m 25s
1. Introduction to Data Structures
4. Stacks and Queues
5. Hash-Based Data Structures
6. Trees and Graphs
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.