Introduction to Linked Lists (Data Structures & Algorithms #5)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hey, everyone And this video, I'm gonna give you a quick introduction to linked list And in this video, I'm only gonna cover the very basic of linked lists. But I'll cover more advanced topics in a later video. Now a linked lists is basically a data structure for storing a collection of item. For example, these numbers 6, 3, 4, 2 and 1 and it does in a different way from the way an array does it So as we saw in my previous video an array can be visualized as a long box with many partitions of the same size and a linked list can be visualzed as many boxes that are connected to each other and the difference between an array and a linked list will be more clear in a later video But let's first focus on how a linked list can be implemented in this video. Now each of these boxes in a linked list can be represent as an object And let's say the class for that objects is called the Box Actually we will rename it later. We're gonna change the name later. but let's for now call it Box And it's gonna have two attributes or 2 fields in this class. and first one of those attributes is gonna be called 'data' it's gonna be the data or the item each box contains so if you have... let's say the first box in a variable called head if you write head dot data that's gonna give us this value 6 right there that's the data - head the first box contains and the type of data could actually be anything it could be an integer. it could be a string a character or anything else for there matter but here I just assume that it's an integer. just for simplicity And that's why I wrote int data here. and the second attribute here or the second field is gonna be called next. That's gonna refers to the next box that's connected to the particular box if you write head dot next that's gonna refer to the next box
Info
Channel: CS Dojo
Views: 620,676
Rating: 4.9498625 out of 5
Keywords: linked list java, linked list python, linked list java implementation, linked list algorithm, data structures and algorithms
Id: WwfhLC16bis
Channel Id: undefined
Length: 18min 46sec (1126 seconds)
Published: Thu Apr 12 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.