Learn how to use the Linked List class and its various operations in Java so you can take advantage of what this data structure has to offer in your programs.
- [Instructor] Now let's use the linked list class…that's built into Java to create a travel bucket list.…We're in Jdoodle, and we can select Java…as our programming language.…The first thing we're going to need to do…is delete this code inside of our main function.…To use a linked list, we have to import it…into our program because it's not in our current package.…So we'll write import.java.util.LinkedList…and now we'll be able to use this data structure…or the library for this data structure.…
To create a linked list, we'll write…LinkedList travelBucketList…that's what we're going to be calling our linked list…and then we're going to create this new…linked list with the constructor.…So how do we add items?…Well there are a couple different ways we can do it.…First we can just add an item ordinarily.…So we'll add an item to our linked list.…Next we could add an item to be the first of our linked list…so adding to the front of the linked list.…Next we could add to the back of our linked list…with add last.…
And then on line 11 we add to a specific index.…
- 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.