Тёмный

Linked List Data Structure | JavaScript 

Traversy Media
Подписаться 2,3 млн
Просмотров 208 тыс.
50% 1

In this video we're going to learn about linked lists using OOP JavaScript (ES6 Classes). Linked lists are very popular in interview settings and are good to know.
Code:
gist.github.co...
Sponsor: DevMountain Bootcamp
goo.gl/6q0dEa
💖 Become a Patron: Show support & get perks!
/ traversymedia
Follow Traversy Media:
/ traversymedia
/ traversymedia
/ traversymedia

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 397   
@TraversyMedia
@TraversyMedia 5 лет назад
I am a little rusty on algos, data structures, etc but would like to get into this type of stuff, let me know what you guys think about that.
@Ath9394
@Ath9394 5 лет назад
Yes brad please make a crash course or even better a whole data structure series. thanks
@ytubelord
@ytubelord 5 лет назад
Please Continue to do more. It makes us industry ready
@lancerino765
@lancerino765 5 лет назад
No, You are awesome
@alaindimabuyo
@alaindimabuyo 5 лет назад
Im bad too when it comes to algorithms I keep forgetting about these things
@TraversyMedia
@TraversyMedia 5 лет назад
@@alaindimabuyo Yeah, they aren't things I use in my daily projects, however they are great for building muscle in that part of the brain :)
@sushantkunkekar2155
@sushantkunkekar2155 5 лет назад
Hey Brad please upload Data structures in js crash course or big course ...please
@andrewtelkamp1750
@andrewtelkamp1750 4 года назад
Great video, thanks for taking the time to put this together this together @TraversyMedia! One small thing. For you insertAt() and removeAt() functions, I'm pretty sure you want to flip the sign and use an || operator to account for less than 0 values. `if (index < 0 || index > this.size)`
@network9990
@network9990 4 года назад
I wasn't able to understand all of this after weeks in a computer science course, but 30 minutes into your video I have a much better understanding. You are great at explanations and don't over complicate topics. Thank you so much for this video!
@hectorserrano9314
@hectorserrano9314 2 года назад
When I first watched this video almost three years ago I was completely lost and could never follow along. I took another shot yesterday and was able to understand it now. If anyone needs help, I will gladly set up a google meet call and explain it with a debugger trace if we need to. Just passing along what others have done for me in the past. Thank you Brad, this was a great explanation!
@emilewamsteker3412
@emilewamsteker3412 4 года назад
This dude is a genius. Not just as a developer, but as a teacher. Thanks, Brad! Data structures is by far the most significant hurdle in programming, and I haven't been able to find anyone who can explain the concepts at a level I can understand. It's hard to teach concepts that are basically abstractions built upon abstractions. But from all the resources I've looked at, Brad has come closest, and in JavaScript no less. Bring on more data structures!
@dm.hol.3624
@dm.hol.3624 3 года назад
nah, his voice is quite boring, it sounds like he wants to just close the editor and throw his monitor out of a window. There is an example of a good teacher/programmer - "net ninja", I strongly recommend to look at his videos.
@Balowulf
@Balowulf 5 лет назад
Excellent introduction to a new topic for me! One edge-case we're missing here for the insertAt() method is a negative value being passed as the index. I found that this can be better handled by setting up the "index out of range" conditional to be: "index < 0 || index > this.size", so we simply return (do nothing with the data value) if the index is less than 0 or greater than the size of the linkedList. In my testing that gives us the functionality we want, without a resulting "Cannot set property 'next' of undefined" if a negative index value is passed.
@goldenfibonacci7860
@goldenfibonacci7860 3 года назад
thank you for always being straightforward and keeping it concise. Been watching your videos and following your tutorials for the past year and they have been an immense help. much love from California!
@MeshTheSnake
@MeshTheSnake 2 года назад
the goat, feeling much more comfortable with LinkedLists after this video. Thank you.
@yaniasari4716
@yaniasari4716 2 года назад
15:49 "Just don't be a dick about it please." LOL! Thanks for being a real one Brad, and for always producing easy-to-follow videos.
@vaibhavmavani1071
@vaibhavmavani1071 4 года назад
// Insert at index insertAt(data, index) { // If index is out of range if (index > 0 && index > this.size) { ---------this line should be like this----------> if (index < 0 || index >this.size){) return; }
@chanduallada2417
@chanduallada2417 4 года назад
I checking for this comment :)
@badmusadeyinka1662
@badmusadeyinka1662 3 года назад
That'd mean it won't insert when index is greater than zero even if it's less than the list size. if (index > 0 && index > this.size) is correct.
@Ash-em5pm
@Ash-em5pm 5 лет назад
Quite glad that you are getting your feet in core CS . It's a rabbit hole from here on and it's really fun as you start diving deeper.
@fanwilliam7725
@fanwilliam7725 Год назад
Thanks for the tutorial, I was doing an exercise from Odin Project and can't seem to wrap my head around this list. Your demonstration was very helpful, once I figured out the head variable was the key to this linked List structure, I picked this up real fast. Thanks!
@alexanderpotapov2774
@alexanderpotapov2774 Год назад
that's a great example of creating and working with Linked Lists on JavaScript. Thank you
@fromillia
@fromillia 5 лет назад
Brad i realy don`t understand why you don`t have at least a million subscribers. You're one of the best youtube IT-blogers (for me you`re the best).
@poka247
@poka247 11 месяцев назад
You make learning so much easy. Really appreciate you taking the time to make me understand this better than most tutorials out there!!!!
@moayedmustafa9673
@moayedmustafa9673 4 года назад
Dude this should indeed be a series, best explanation ever on this topic
@vijayroy7634
@vijayroy7634 5 лет назад
you just blow it!!!! How you even do it ....I must say you are X-MEN Mutant YOU JUST MADE LINKDLIST SUPER EASY WITH MOST CONFUSING MODERN JS WOW
@sultanhoodie5495
@sultanhoodie5495 Год назад
the best video i have seen about linked lists, simple and straight to the point. Well done.
@irhamputra3666
@irhamputra3666 5 лет назад
Thanks Brad, you did an amazing job again. Finally you did data structures and algorithm 👏🏼💪🏻
@ethanappleseed7530
@ethanappleseed7530 2 года назад
"just don't be a dick about it please" caught me off guard. So funny. Thanks for the video, helps to hear different people talk about data structures.
@thaungthanhan5928
@thaungthanhan5928 Год назад
This tutorial made linked links easy for me
@rajeshchauhan657
@rajeshchauhan657 5 лет назад
Great tutorials , sir You made me a real Developer.
@malibaturhan
@malibaturhan 5 лет назад
Best tutorial about linked lists. Not just for JS. I searched for java too and this is the best I saw. Since there is just some difference in syntax every c# or java programmer should watch this too.
@LenTos1337
@LenTos1337 5 лет назад
Initially i did this data structure on my own and then watched your implementation, and this really makes your brain find different solutions
@maciepyou
@maciepyou 5 лет назад
this brings me back (comp sci degree, but never got a job at it)...good stuff! I think maybe for inserting at index the bound check could be index < 0 || index>size? although using a negative index to insert from the end would be a fun exercise too.
@mikevaleriano9557
@mikevaleriano9557 5 лет назад
@ 7:10 I saw you almost naming your method insertHead.
@musicmasala2391
@musicmasala2391 2 года назад
Please make a complete series of data structures and algorithms in javascript.
@kylegashler5995
@kylegashler5995 3 года назад
I think that you flipped your comparator on line 46. I think you meant to look like ` if (index > 0 || index > this.size) {` which would account for possible negative indexes provided, whereas checking for positive indexes seems like the case that you are looking to execute on.
@MyOsmancan
@MyOsmancan 2 года назад
You taught so much about something so difficult, even to people like me who don't understand clear English. Amazing! Thanks for simple explanation dude
@nd6439
@nd6439 5 лет назад
More algos + data structures please! Also some techniques + tips and tricks on how to solve problems. Your tutorials are very informative and easy to understand.
@ahmedouyahya
@ahmedouyahya 4 года назад
This is my getAt method, if you find it more clear: getAtIndex(index){ if(index>0 && index>this.size) return let count = 0 let currentNode = this.head while(count
@ytubelord
@ytubelord 5 лет назад
Finally some data structures Thanks
@itsshopboy
@itsshopboy 5 лет назад
Can't wait for that. The normal projects have become quite popular here on RU-vid
@bradliu1891
@bradliu1891 5 лет назад
Hi Brad, I've been watching your video for years. A little surprised seeing you started algos and data structures. Thanks for sharing. Love you, your Chinese fan.
@TutoFreeTime
@TutoFreeTime 4 года назад
C'est la base d'algorithme de liste chaînée. Très bien expliquée
@erickchavez4551
@erickchavez4551 2 года назад
Thanks a lot for taking the time to explain this. I've been having a difficult time understanding the logic behind linked lists, but now I feel like I am getting it :)
@MULTICODE
@MULTICODE 5 лет назад
haha i'd been doing this in school algorithm and data structure, we used to implement double linked list. great to see that you jump into it. this course is really cool and understandable. great work . Love From Cameroon
@kamalhm-dev
@kamalhm-dev 5 лет назад
Yes! More data structures please
@kirant9339
@kirant9339 5 лет назад
Hey Brad , just want to thank you for all the efforts you take for us.And please upload the important topics of javascript in the point of interview please.
@hliasfasilakhs6765
@hliasfasilakhs6765 Год назад
Amazing man. Thanks for everything. Trully amazing. i grasped everything after carefully watching the video
@hanzezhu7506
@hanzezhu7506 2 года назад
For ppl who might be confused in the first place how we remove the node from list: if there is nothing that points to a specific node the node and all of the nodes next to it are all gone due to memory cleaning.
@dinner4chiahao
@dinner4chiahao 2 года назад
Really helpful! Thanks again Brad!
@TheYogeshkulkarni
@TheYogeshkulkarni 5 лет назад
Thank you Brad. Aye for the series on data structures and algorithms. I watch your videos for dual purpose, to learn and to fall asleep.
@blasttrash
@blasttrash 5 лет назад
r u implying that his vids are boring? :P
@TheYogeshkulkarni
@TheYogeshkulkarni 5 лет назад
@@blasttrash Naah man :), videos are damn good and informative, but he has this amazing white noise like voice, so if you watch during the night, you will fall asleep in no time. Try it :P
@darko.ristanovic
@darko.ristanovic 5 лет назад
Yes! More of these please. Maybe some video about pointers and stuff like that.
@akintaylor2414
@akintaylor2414 5 лет назад
Hey Brad thank you so much man. It's important you know your work is helping people out here. I am more confident in my Javascript cause of your course.
@soumadip_banerjee
@soumadip_banerjee 2 года назад
Love from India Brad ❤️
@tom-badger
@tom-badger 5 лет назад
Shouldn't early return condition be like (index < 0 || index >= this.size) ? Otherwise if you pass negative value as index it will pass through range check and break data structure.
@josiah7686
@josiah7686 3 года назад
Nice LL overview that is easy to follow and understand. Thanks!
@abhis3kh
@abhis3kh 2 года назад
THis is pure knowledge :) Thanks Brad
@abduljalilabdallah9578
@abduljalilabdallah9578 5 лет назад
We doing data structures now? Hurrayyy
@jansherkhan590
@jansherkhan590 5 лет назад
Hi brad Sir, without watch this video because I know you always bring great stuff that is easy to learn. I am greatfull you.
@sunnyyuen3237
@sunnyyuen3237 3 года назад
i had a hard time twisting my head around the logic around the insertAt method during the tutorial, especially at the pt where { node } is being assigned to { previous.next }. what helped me was putting a console log statement after line 67 for node and after 68 for previous to see what's going on. conceptionally, we're creating a new node passing in the data and currentNode, then placing the reference in the previous node's next node property.
@bodolawale5448
@bodolawale5448 5 лет назад
Thank you Brad. You are turning me into an awesome developer.
@planetmall2
@planetmall2 5 лет назад
Great video Brad. Thanks so much. Request for future video -- I am working on a project connecting two rest API's. One with Oauth2 and another just Bearer. Basically, make a call every 15-30 minutes to get JSON data and then post JSON data. Wondering how you would set this up so I could learn. Thanks!
@narendrajoshi5460
@narendrajoshi5460 5 лет назад
Thanks brad for your efforts. would love to have a series on data structures and algorithms.
@pushpakgupta7396
@pushpakgupta7396 5 лет назад
please either make a series of all the important data structures or tell us where to find them on the internet(with code in js)...thank you for everything :)
@AbhishekKumar-mq1tt
@AbhishekKumar-mq1tt 5 лет назад
Thank u for this awesome video, please make whole series on data structure
@0the0ambient0
@0the0ambient0 3 года назад
As always, your tutorial is the best. Thank you!
@bushcommander2205
@bushcommander2205 2 года назад
Amazing explanation, thank you so much!
@rachkashyap
@rachkashyap 4 года назад
At 15:05, for the method insertAt(), shouldn't the edge case be if(index < 0 & & index > this.size)
@620026200
@620026200 4 года назад
Thank you! Your video is even better than a book i bought
@antoniovaldenisiobezerraju2550
Thanks for this new lesson! I loved it. I would thank much more for other lessons about those programming core subjects applied to JavaScript.
@rickrieger1495
@rickrieger1495 2 года назад
Thank you for all the wonderful content
@theanhtran2595
@theanhtran2595 5 лет назад
I look forward to the course React-Native. Please do it on udemy. I believe many people expect this like me
@siddhantjain2402
@siddhantjain2402 5 лет назад
Hi Brad. I have a question. I have seen a lot of companies focus on Data Structures and Algorithms in their Placement Tests but having worked with some tech companies I have never seen much use of DSnA. Most of the work these days is already done for us. Then why so much focus on DSnA? Could it be that I am just not at that level..?
@awaterplease7885
@awaterplease7885 5 лет назад
Really liked this video.I'm gonna implement this kind of datastructure in a C project soon and this simple example really helped to get a good idea of how the basic functions should work. If you want to make another video about data structures then Graphs might be a nice data stucture to use, since you can build a graph that consists of multiple linked lists. Another idea you might like to throw in is a Douby Linked List, but that's not too different from Singly Linked Lists ofcourse. Thx for this video my friend.
@parasarora5869
@parasarora5869 5 лет назад
woww sir...awesome !!!..i recently started learning data structure and algorithms and took a break from web dev
@jwchavez
@jwchavez 5 лет назад
Nice video Brad, i´m a little bit rusty also with algos, I learnt them long time ago in Pascal and C, so getting a refresh in JS was great. What's next? Heaps, Stacks, B-Trees? Thanks again and regards from México!
@vishnuumakanthan9583
@vishnuumakanthan9583 5 лет назад
Hey Brad , really love your work . Thanks a lot. A big inspiration for me.
@VikasChauhan-Master
@VikasChauhan-Master 5 лет назад
Your effort and tutorial help us alot. Love to learn data structures in JavaScript from you
@biikaaa.6540
@biikaaa.6540 2 года назад
correction for insertAt() index should be less than 0 for the first if
@adamnorman85
@adamnorman85 5 лет назад
I love the way you play with. You are talented in how to deliver information Thnx 😘 bro
@Allsjr
@Allsjr 5 лет назад
Definitely would like to see more on data structures.
@bleakCode
@bleakCode 5 лет назад
You explain things very well. I always come back here to learn new sorcery :P
@aytacg26
@aytacg26 2 года назад
Thank you very much for this great course.
@devsaurabh
@devsaurabh 3 года назад
Please do make more of these 🙏
@chetanharicharan8796
@chetanharicharan8796 2 года назад
It was perfect, really helped . Thanks a lot!!
@snek4057
@snek4057 5 лет назад
Thanks Brad, please do more of these
@shamima2hossain193
@shamima2hossain193 5 лет назад
why not make a project using the popular data structures to reinforce the concepts...ur videos are an all time fav btw
@tonmoygaming7663
@tonmoygaming7663 5 лет назад
Please Make Data Structure playlist...😊
@chethankambi31
@chethankambi31 5 лет назад
Please do more of these. Thanks!
@euyin77
@euyin77 4 года назад
Sorry, in line 44 (index out of range) shouldn't be if(index < 0 || index > this.size)?
@TakurTube29
@TakurTube29 9 месяцев назад
Great as usual
@lulusaikou221
@lulusaikou221 4 года назад
This video really helps me a lot, thank you very much!
@asifurrahman5436
@asifurrahman5436 2 года назад
Thank you so much brad!
@joshysmarty2540
@joshysmarty2540 4 года назад
This is the best explanation I got.. thanks
@gregorymurunga8046
@gregorymurunga8046 5 лет назад
Finally I got an aha light bulb moment thank u for making me understand 💡💡💡
@manish-mk
@manish-mk 5 лет назад
Awesome. I was waiting for this. Please make more data structure and algorithm videos
@soad2609
@soad2609 5 лет назад
Hello, Can you make a video on designing and developing a fullstack website? Something like an e-commerce store or a dynamic news portal?
@j03Biz
@j03Biz 4 года назад
Love it! Gave a like! I really wish I can subscribe, but unfortunately the button says "SUBSCRIBED" and its grey'd out. Sorry bro 😐
@bodolawale5448
@bodolawale5448 5 лет назад
Why was (index > 0) condition there for the insert at index function. Why not just (index > this.size).. Thanks for the reply
@ashutoshsinghai713
@ashutoshsinghai713 5 лет назад
I would love to watch a complete series on data structures and algorithm in JavaScript
@ehud4
@ehud4 5 лет назад
Really enjoyed your video on linked lists. Why would you use a linked list over an array?
@qazyhn94
@qazyhn94 5 лет назад
thats awesome! we need more of this!
@And1997Ruz
@And1997Ruz 2 года назад
Aren't you supposed to keep the reference to the tail? Because it seems like, if you don't, adding to the end of the list is now O(n) operation, instead of O(1)
@cyberwizard728
@cyberwizard728 Год назад
thank you , this was way too helpful video
@pawanrk4818
@pawanrk4818 4 года назад
Hey, is this ordered or unordered LinkedList ?
@abhishekrawat8579
@abhishekrawat8579 2 года назад
awesome explaination 🔥🔥
@cyperdevelopment
@cyperdevelopment 5 лет назад
It's great please continue
Далее
Stack Data Structure | JavaScript
16:29
Просмотров 98 тыс.
Why You Should AVOID Linked Lists
14:12
Просмотров 277 тыс.
How to Implement a Hash Table in JavaScript
25:39
Просмотров 104 тыс.
Linked List. Data Structures | Implementation in JS
35:49
Linked Lists for Technical Interviews - Full Course
1:27:24
JavaScript Data Structures: Getting Started
1:36:47
Просмотров 241 тыс.