How To Implement Linked Lists With Test Driven Development In JavaScript

preview_player
Показать описание
Linked lists are one of the most popular data structures interviewers ask about in technical interviews. You will probably never have to implement one in a real day to day job, but knowing how to write a linked list and understanding how they work is crucial to passing a technical interview.

On top of covering linked lists in this video, I will also be covering how you can use test driven development to make writing code easier. We will be designing the entirety of the linked list with test driven development to show you how to write better tests.

📚 Materials/References:

🧠 Concepts Covered:

- How to do test driven development
- What a linked list is
- How to create a linked list
- How to write proper tests

🌎 Find Me Here:

#LinkedList #WDS #JavaScript
Рекомендации по теме
Комментарии
Автор

you have a real gift man, it's crazy how you're able to make something as boring as test driven development and linked lists actually somewhat interesting and easy to follow

jenso
Автор

Please make an entire playlist on javascript data structures.

____prajwal____
Автор

0:43 - start
2:12 - Doubly Linked List
3:12 - why would we use a linked list?
4:48 - implementing a linked list.
4:56 - installing dependencies
6:25 - starting to code
6:29 - linkedlist class
7:34 - node
8:30 - insertAtHead method
8:26 - creating the first method that will allow to add elements/nodes to the linkedlist
10:05 - instantiating a new linkedlist
12:11 - writing first test

kristiannn
Автор

You're so consistently thorough and generous with the information you share in each of your videos. Thank you so much.

DannySingerMusic
Автор

Liked the video first because KYLE does an amazing job everytime.

IshanKesharwani
Автор

Great tutorial! One hint to take small step further and make it complete: Coverage report says that lines 49-55 are not covered. This is the print method. We can simply return the output and test if it contains an inserted value. For example Then we will have 100% green as what uncle Bob recommends ;).

devchamber
Автор

I really dig these fundamental programming tutorials! Your removeHead function does not account for cases of an empty LinkedList. A case that you also missed in your test which again shows how important it is to think of any possible case.

carlthegnarl
Автор

I watched several videos on linked list and this is the best of all. this video really helped understand linked list and well explained. Good job man keep it up.

amrit
Автор

Great explanation. I remember creating linked lists in the ol' good C++, but that was my biggest struggle. My approach to the concept was trying to compare it to the SQL database where you can remove values without losing the slot it was once stored (the line in the database for that matter). I've never really known whether SQL used empty indexes in disguise, but I don't think so.

NoBrainerLanguages
Автор

Great Work Man, Special the Node class I really like the way you created node class,
just by adding the next value in the second parameter, it eventually reduce the code for another methods.
Thank You so much.

saddamshah
Автор

you are best teacher, as a beginner programmer this channel really helped me thanks ✨

k-universe
Автор

After simplifying all the web for us without any cost now you are helping us with interviews.. hats off💓

romanazeem
Автор

so happy i finally get to see test driven development in action! thanks for this

honeypot
Автор

You never disappoint! Thank you for clearly explaining so much in 40 mins. It helped me revise linked lists and more importantly I learned so much about test driven development.

nsharma
Автор

Hi Kyle! Interesting video like always.
One thing, I've noticed is the line `LinkedList.js#44` (`prev.next = prev.next.next`).
You expect the `prev.next` (node at the current index) to always exist.
The reason, why the particular test passes is the line `LinkedList.test.js#116`, where You forgot to change the argument of `ll.removeAtIndex(-1)` to, for instance "2".

piotrzielinski
Автор

Real nice video man,
Thanks for simplifying linked list ....

akshaynair
Автор

This is great. You explain these concepts very well, thank you!!

mlntdtechbae
Автор

Tip! You can create another shadow list or array for mapping index numbers and reference original list items to them and you can use that map to avoid loops against the list.

biliyonnet
Автор

17:50
If the point of the helperfunction was to test method#getByIndex without relying on the method#insertAtHead working then why does the helper-function USE the method#insertAtHead?

TheDopoqob
Автор

Fantastic video Kyle. It was great to see test drive development with this, very intuitive. I'll be doing that exercise myself! Need those reps 👍

Only feedback I'd suggest is to mention how data in LL are stored in memory vs arrays, even just a link to a resource could be useful.

Fantastic demo though, thanks!

nicbongo
join shbcf.ru