Linked List Data Structure | JavaScript

  Рет қаралды 210,197

Traversy Media

Traversy Media

Күн бұрын

Пікірлер: 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)`
@chocolate_thunder_04
@chocolate_thunder_04 5 жыл бұрын
Can you do queues, stacks, trees, graphs, recursion? if possible Just a whole series on Data structures and algorithms
@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!
@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!
@Ath9394
@Ath9394 5 жыл бұрын
Hey Brad , just want to thank you for all the efforts you take for us.. Would love to have a series on data structure Javascript. Love from India 💓
@Сергей-е4г5п
@Сергей-е4г5п 5 жыл бұрын
From East Europe too)
@rakeshreddy1365
@rakeshreddy1365 2 жыл бұрын
from india too
@parashuramakulakarni5073
@parashuramakulakarni5073 5 жыл бұрын
Most awaited. Please do more videos on data structures.
@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.
@eldonratzlaff
@eldonratzlaff Жыл бұрын
Line 93 change(index > 0 && index > this.size) to if (index < 0 || index > this.size)
@robertmacdonald3773
@robertmacdonald3773 Жыл бұрын
I'm a Full Stack student and just wanted to thank you for this video! It really helped me wrap my brain around the concept of Linked Lists👊🏾
@alexanderpotapov2774
@alexanderpotapov2774 Жыл бұрын
that's a great example of creating and working with Linked Lists on JavaScript. Thank you
@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
@fanwilliam7725
@fanwilliam7725 2 жыл бұрын
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!
@sultanhoodie5495
@sultanhoodie5495 Жыл бұрын
the best video i have seen about linked lists, simple and straight to the point. Well done.
@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.
@moayedmustafa9673
@moayedmustafa9673 5 жыл бұрын
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
@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!
@poka247
@poka247 Жыл бұрын
You make learning so much easy. Really appreciate you taking the time to make me understand this better than most tutorials out there!!!!
@AnatolioMoskalenko
@AnatolioMoskalenko 3 жыл бұрын
Thx you saved my life... I had a project to do for tomorrow and I knew nothing about that ... I was doing Java but the options are the same so thank you very much
@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
@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.
@bobbymcgee723
@bobbymcgee723 5 жыл бұрын
I think it's great that you've started getting into this topic. I've had a lot of trouble reading about this stuff and then implementing it. But seeing it from you, then thinking about it for a bit, then going back and trying it myself, has really done the trick.
@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.
@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.
@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
@thaungthanhan5928
@thaungthanhan5928 Жыл бұрын
This tutorial made linked links easy for me
@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.
@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.
@randydiebold325
@randydiebold325 3 жыл бұрын
Thank you for doing this. Please do them for all of the Data Structures. This will be super useful for people try to start out
@nanonkay5669
@nanonkay5669 5 жыл бұрын
Bro, do all the data structures PLEEEEEEEAAAAAASE. I've been looking for videos that discuss data structures and here you are. God sent. Please do more. Pleeease pleeease
@MeshTheSnake
@MeshTheSnake 2 жыл бұрын
the goat, feeling much more comfortable with LinkedLists after this video. Thank you.
@rajeshchauhan657
@rajeshchauhan657 5 жыл бұрын
Great tutorials , sir You made me a real Developer.
@blaquebeardcoder
@blaquebeardcoder 3 жыл бұрын
This was very helpful! Today we are learning LInked Lists and React in bootcamp, and this is a great prep for class tonight! Thank you for creating this content!
@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).
@pablitoengineer
@pablitoengineer 2 жыл бұрын
Hey, Brad, nice explanation. Thanks a lot for this excellent video. I would like just to make a small correction. It seems your range validation is not totally right. You wrote: if (index > 0 && index > this.size), but it will fail passing negative indexes. I believe the correct would be if (index < 0 || index > this.size). What do you think?
@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.
@stevemiller123
@stevemiller123 3 жыл бұрын
The way you wrote the Remove method would make it impossible to delete the first item in the list. Here is a version that would let you delete the first item: remove(index){ let current = this.head let previous let count = 0 if (index === 0){ this.head = current.next this.size--; } else{ while (count < index){ count++ previous = current current = current.next } previous.next = current.next } this.size--; }
@620026200
@620026200 5 жыл бұрын
Thank you! Your video is even better than a book i bought
@TutoFreeTime
@TutoFreeTime 4 жыл бұрын
C'est la base d'algorithme de liste chaînée. Très bien expliquée
@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.
@buncha1499
@buncha1499 5 жыл бұрын
Of course as i've been getting into linked lists, here Brad is with a brand new course on it, love it!
@hliasfasilakhs6765
@hliasfasilakhs6765 Жыл бұрын
Amazing man. Thanks for everything. Trully amazing. i grasped everything after carefully watching the video
@AlaminPiash-c6i
@AlaminPiash-c6i Жыл бұрын
thanks for awesome tutorial. but you have to use "break" within getAt() -> in if(count==index) condition. otherwise it traverse till the end.
@mahmudulhassan9043
@mahmudulhassan9043 5 жыл бұрын
Thank you very much Brad.I learn many things from you and i like the way you teaching us.please make a full course on data structure , algorithm and graph...Love from Bangladesh
@arditgjondedaj6143
@arditgjondedaj6143 5 жыл бұрын
Programming itself is an algorithm and this is useful. Thank you !
@chawkichalladia1812
@chawkichalladia1812 5 жыл бұрын
i worked with linked lists with c programming language so i might be a bit biased but with js this seems like whole lot of mess compared to c. good video though it's always good to let people know about other tools and structures. keep up the good work.
@rickrieger1495
@rickrieger1495 2 жыл бұрын
"Don't be a dick about it" I love how honest you are man...
@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.
@mnz4829
@mnz4829 3 ай бұрын
thank you, your tutorials are helping us a lot a appreciated. 🙏
@bodolawale5448
@bodolawale5448 5 жыл бұрын
Thank you Brad. You are turning me into an awesome developer.
@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 :)
@jonesgabriel9337
@jonesgabriel9337 Жыл бұрын
This video was super helpful and informative. thank you Brad!
@irhamputra3666
@irhamputra3666 5 жыл бұрын
Thanks Brad, you did an amazing job again. Finally you did data structures and algorithm 👏🏼💪🏻
@rajsaroj4696
@rajsaroj4696 4 жыл бұрын
First 10 mins was all i needed, my professor couldn't explain this in 3 hrs.
@patrykkaczor6509
@patrykkaczor6509 5 жыл бұрын
I have an algorithms and data structures course next semester at college so would like to see more videos like that, discussing various algos and data structures...
@josiah7686
@josiah7686 3 жыл бұрын
Nice LL overview that is easy to follow and understand. Thanks!
@musicmasala2391
@musicmasala2391 2 жыл бұрын
Please make a complete series of data structures and algorithms in javascript.
@fdc_8507
@fdc_8507 5 жыл бұрын
very nice to start on Data structures and algorithm there a tons of this but not much more easier than you brad I really enjoying to see your tutorials
@nicolegathany9626
@nicolegathany9626 4 жыл бұрын
I laughed in this coffee shop when you said, "But don't be a dick about it!" Haha!
@frankie_goestohollywood
@frankie_goestohollywood 4 жыл бұрын
Me too..that was great!!! :-)
@vincentadeniji6403
@vincentadeniji6403 3 жыл бұрын
and here I thought it was only me rofl.
@codingfox
@codingfox 5 жыл бұрын
Please, more videos about algorithms and data structures
@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.
@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
@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.
@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 :)
@adamnorman85
@adamnorman85 5 жыл бұрын
I love the way you play with. You are talented in how to deliver information Thnx 😘 bro
@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.
@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.
@SokarRomania
@SokarRomania 5 жыл бұрын
Hi Brad, nice video! I think insertAt should test for index < 0 || index >= this.size and return
@itsshopboy
@itsshopboy 5 жыл бұрын
Can't wait for that. The normal projects have become quite popular here on KZbin
@AtlanteAvila
@AtlanteAvila 3 жыл бұрын
In terms of operations and assignments (memory complexity) and this might just me being nitpicky... Wouldn't it be better to not assign the previous in the while loop and just assign the previous outside of it? This was my solution before looking at yours, this seems a bit easier to understand and remember in my opinion as you're just initializing a new node at the time of updating the list instead of the near-circular assignments your code goes through. I love these tutorials of yours, and hope you keep them coming! let current = this.head; // same as yours... let count = 0; while (count < location) { current = current.next; count++; } let previous = current.next; // now it's time to store the previous as opposed to at every iteration current.next = new Node(element, previous); // initialize the new node with the previous as the new next. this.size++ I feel like this might make a difference in a job interview. But again, I might be nitpicking as I'm preparing for a job interview.
@mikevaleriano9557
@mikevaleriano9557 5 жыл бұрын
@ 7:10 I saw you almost naming your method insertHead.
@narendrajoshi5460
@narendrajoshi5460 5 жыл бұрын
Thanks brad for your efforts. would love to have a series on data structures and algorithms.
@AbhishekKumar-mq1tt
@AbhishekKumar-mq1tt 5 жыл бұрын
Thank u for this awesome video, please make whole series on data structure
@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!
@darko.ristanovic
@darko.ristanovic 5 жыл бұрын
Yes! More of these please. Maybe some video about pointers and stuff like that.
@ytubelord
@ytubelord 5 жыл бұрын
Finally some data structures Thanks
@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.
@israelkusayev5822
@israelkusayev5822 5 жыл бұрын
You can save the last and save the whole iteration in insertLast
@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
@Allsjr
@Allsjr 5 жыл бұрын
Definitely would like to see more on data structures.
@oquetemprajogar
@oquetemprajogar 3 жыл бұрын
Hey Brad. Great video. I notice a small problem(?). You use "if (index > 0 && index > this.size)" but if we pass a negative index, the application will throw an error. Instead of "if (index > 0 && index > this.size)", we could use "if(index < 0 || index > this.size)". What do You think?
@wasidhossain3848
@wasidhossain3848 2 жыл бұрын
still excellent explanation in 2022, thanks a lot
@mohdnawazishalam3255
@mohdnawazishalam3255 5 жыл бұрын
Please make a full series on data structure and algorithm and please describe its uses!!
@abduljalilabdallah9578
@abduljalilabdallah9578 5 жыл бұрын
We doing data structures now? Hurrayyy
@quickSilverXMen
@quickSilverXMen 8 ай бұрын
00:08 Linked List is a linear data structure using pointers to link elements 02:21 Linked list consists of nodes linked together with references 04:40 Creating and initializing a Node and Linked List class in JavaScript. 07:26 Linked List insertion and printing in JavaScript 10:14 Inserting data into a linked list and understanding the order of insertion. 13:03 Inserting elements into a linked list using JavaScript 15:46 Creating a linked list in JavaScript with inserted nodes 18:30 Adding nodes to a linked list 20:50 You can insert wherever you want, no strict rules, just follow basic principles of linked list. 23:35 Implementing remove functionality for a linked list in JavaScript 26:52 Demonstrating removal and clearing of a linked list. 29:16 Explore logic, problem-solving, and more. Crafted by Merlin AI.
@MohitKumar-nh1qb
@MohitKumar-nh1qb 4 жыл бұрын
Hey Brad, Try with below use case, your code fails const ll = new LinkedList() ll.insertFirst(5) ll.insertFirst(6) ll.getAt(1) ll.insertLastNode(10) ll.removeAt(3) ll.printData() previous.next = current.next ^ TypeError: Cannot read property 'next' of null
@VikasChauhan-Master
@VikasChauhan-Master 5 жыл бұрын
Your effort and tutorial help us alot. Love to learn data structures in JavaScript from you
@sumanthpai5579
@sumanthpai5579 5 жыл бұрын
Thanks a lot Brad , we are awaiting your expert videos on exhaustive list of data structures like Stacks,Queues,Circular-Queues,Circular Linked list, More operations on linked list, Doubly linked list and all its operations , Tree,Binary tree, HashTable,HashMap,Binary search tree last but not least AVL trees . This would immensly help the Javascript community over there . With bestest regards-Sumanth
@biikaaa.6540
@biikaaa.6540 3 жыл бұрын
correction for insertAt() index should be less than 0 for the first if
@parasarora5869
@parasarora5869 5 жыл бұрын
woww sir...awesome !!!..i recently started learning data structure and algorithms and took a break from web dev
@rachkashyap
@rachkashyap 4 жыл бұрын
At 15:05, for the method insertAt(), shouldn't the edge case be if(index < 0 & & index > this.size)
@kamalhm-dev
@kamalhm-dev 5 жыл бұрын
Yes! More data structures please
@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..?
@ashutoshsinghai713
@ashutoshsinghai713 5 жыл бұрын
I would love to watch a complete series on data structures and algorithm in JavaScript
@passandscore_
@passandscore_ 3 жыл бұрын
Awesome video. Please do more videos on data structures.
@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.
@NasirulIslamSiat
@NasirulIslamSiat 5 жыл бұрын
Thank you very much, a must needed topic to discuss. Thank you brad and please upload more videos on algorithms. Thank you
@1wf
@1wf 5 жыл бұрын
Do more algos and data structures! Thanks for the awesome videos!
Stack Data Structure | JavaScript
16:29
Traversy Media
Рет қаралды 99 М.
Why You Should AVOID Linked Lists
14:12
ThePrimeTime
Рет қаралды 280 М.
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,5 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,3 МЛН
Linked Lists for Technical Interviews - Full Course
1:27:24
freeCodeCamp.org
Рет қаралды 366 М.
Async JS Crash Course - Callbacks, Promises, Async Await
24:31
Traversy Media
Рет қаралды 1,4 МЛН
Linked List. Data Structures | Implementation in JS
35:49
Front-end Science із Сергієм Пузанковим
Рет қаралды 31 М.
The Importance of Specialization in Coding
7:13
Traversy Media
Рет қаралды 237 М.
Learn Linked Lists in 13 minutes 🔗
13:24
Bro Code
Рет қаралды 346 М.
Linked Lists: Basics in Javascript
16:57
Code Brew Latte
Рет қаралды 3,2 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 488 М.
JavaScript OOP Crash Course (ES5 & ES6)
40:21
Traversy Media
Рет қаралды 592 М.
DATA STRUCTURES you MUST know (as a Software Developer)
7:23
Aaron Jack
Рет қаралды 933 М.
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,5 МЛН