How to Initialize a Linked List for Interview Problems in JavaScript (Leetcode) | Fast tutorial

preview_player
Показать описание
In this tutorial, I show you how to initialize a linked list for interview problems that usually only require the head node. Hopefully by the end of this tutorial, you'll know how to create a simple Node class from scratch that you can use to build out a linked list, and get the head node only, without a giant Linked List class.

To speed up the process of initializing a linked list, I start out with an array and iterate through array values to create a linked list. There are many different ways to create a linked list, and this is just one of them! I also show you how to print out your linked list just by passing in the head node.

I noticed that there are many tutorials out there that explain everything there is about linked lists, and those tutorials are great! But I could not find many about the bare minimum amount of code needed to start some of these linked lists problems in your local IDE, like VS Code, which is what I use. So for those curious and wanting to set up your linked lists outside of Leetcode, this should show you how to do it.

Thanks for watching!
Рекомендации по теме
Комментарии
Автор

I really appreciate all of your videos on react and git. The practical examples were all that i need. Thanks.

wholeegg
Автор

Ayo this isn't exactly what i was looking for, but it did clarify some stuff. Good shit.

I want to know more exactly how LeetCode specifically does it and it does similar to yours, but they just, show an array and call it what? I guess the head is just the first element of the array and that's what they're "passing" you but goddamn why do they say they're giving you the head, but write [1, 2, 3, 4, 5] instead of giving you the actual structure of the object!

bc then i have a hard time debugging and trying to work with the problems because I don't really know what can or cannot log

coscorrodrift
Автор

Much appreciated! Like you, I was looking everywhere for ways to efficiently setup VS Code for leetcode SLL problems . I thought it was just me :)
It was a pleasure to listen to you and thank you for a truly helpful tip!

armasconi
Автор

thank you so much. I appreciated for this valuable tutorial

euhansarkar
Автор

This video saved the day for me. Thank you.

OgreTB
Автор

great job 👍, can you please do a video on terminal productive commands for linux

amitthakur
Автор

Could you put it on pastebin or in the description so we don't have to type it out?

AkamiChannel
Автор

what is the purpose of tracking ‘current’ in

mikesholiu
Автор

Please share the code in gist also if possible :) For some, its easy to read through code! Thanks

sijanshrestha
Автор

Jesus Christ 😭 wtf This video literally made this harder than it already is damnit I might as well just quit now

abbaadamu
welcome to shbcf.ru