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

preview_player
Показать описание
Learn the basics of linked lists. Java & Python sample code below.

Special thanks to Brilliant for sponsoring this video.

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


It’s supposed to be for programming interview questions, but it should be a good resource for improving your problem-solving skills in general.

Anyway, thanks as always for watching! If you don’t want to pay for the course, remember that I have a ton of other free videos right here on this YouTube channel :)

CSDojo
Автор

When a YouTube video teaches you better than your programming professor at University lol

davidemilan
Автор

I've been a developer for 25 yrs and i got 2 weeks to prepare for a Google technical interview and I'm relying on your videos to help me prepare. I have to relearn alot of stuff I haven't used in years. You have to go into teaching. America's kids need somebody that can teach as well as you. Thanks kid.

ArmandoAlejandro
Автор

You're an incredible teacher. Hope these videos never end and stretch across even the most advanced of topics. Very enjoyable.

heidik
Автор

You have the best explanation of all the YouTube tutorials out there! Keep up with the good work. I had so much trouble understanding and learning Linked List. If I would have had watched your videos earlier, it would have had definitely made my struggle period shorter. Thank you very much and keep up with the good work. :D

suyashsharma
Автор

You're doing a great job CS. I have already recommended your channel to a dozen friends.
Keep up the good work!

highmaths
Автор

My solution, writing before watching the solution:
int countNodes(Node head){
var count = 1; //As head is not null
while(head.next.data != null){
count++;
head = head.next;
}
return count;
}

Artouple
Автор

Really proud of myself for doing this without looking at any hints. I don't get a lot of exercise questions. I love your method of teaching
My Java Code:

public class LinkedList {

public static void main(String[] args) {
Node head = new Node(6);
Node nodeB = new Node(5);
Node nodeC = new Node(5);
Node nodeD = new Node(5);
Node nodeE = new Node(5);

head.next = nodeB;
nodeB.next = nodeC;
nodeC.next = nodeD;
nodeD.next = nodeE;


}

static int countNodes(Node head){
int count = 1;
Node current = head;
while(current.next != null){
count++;
current = current.next;
}
return count;
}
}

damiajayi
Автор

12:04 a three-line solution from python

def countNodes(head, count = 1):
if head.next != None: return countNodes(head.next, count + 1)
return count

zeno
Автор

best video i ever see about linked list, my teacher explained TWO weeks and THIS MAN EXPLAINS IT IN 18 MINUTES, AND IM STUDYING C++!!!

qxeoqsr
Автор

I was struggling with this for ages! Thank you a lot

satan
Автор

Best and simplest teaching ever...thanks.

vivek
Автор

Excellent videos, thank you for this great tutorial.

My solution in Java is to add the following function to the Node class:

int countNodes() {
if (this.next == null)
return 1;
else
return this.next.countNodes()+1;
}

This will recursively search for child nodes and return the count.

ivanrsbr
Автор

I like the fact that he uses visual examples and actual code to explain the concepts. Most of the time books only have visual examples, and I would understand them, but once it came down to coding it I would just blank out.

kyrinky
Автор

You're the Khanacademy of programming! Love this series and your step-by-step explanations.

acidtears
Автор

This is the best explanation of a Linked List BY FAR. Great job!

seanymiller
Автор

You're just amazing, what I like the most is, you just go straight to the point with very clear examples and NO MUMBO JUMBO...!!!
An old timer Cobol programmer from last century... *lol*

citecx
Автор

I really liked all of your visuals. They all really helped me. Especially having drawn out images next to the code. I really like how you explain everything as well.

isabellahernandez
Автор

Excellent videos! easy to follow and very well organized, awesome job CS Dojo!

lucyanchondo
Автор

watched your video twice. This time finally get the "head" idea. Thank you !!! You simplify everything yet does not lose the key point!!!! Great Work!!!!

Hateusernamearentu