Explore the operations we can use on a linked list so that you can know when to use a linked list in your programs. Learn how to access, insert, delete, and search for a specific piece of data by locating a node in a linked list.
- Just like arrays,…there are specific operations we can use…to add, access, delete and search for items…in a linked list.…To add an item, it's easiest to insert…at the back or front of the list.…When inserting at the front,…we can initialize the new node…with the appropriate data…and set the new node's next pointer…to point to the first node.…When inserting at the back of the list,…we take the last node of the list…and set its next pointer to our new node.…This new node will have its associated pointer pointing…to nothing since it's the last item in the list.…
To access an item, we don't have to have an index…like we do with an array.…This means we have to follow the pointers…until we find the item we want to access.…So, if we want to access the third item in the list,…we would need to grab the first item,…follow its pointer to the second item,…grab the second item…and then follow its pointer to the final item…we want to access.…You might be thinking, this sounsds very similar…to searching and that's because it is.…
- 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.