Linked Lists for Technical Interviews - Full Course

  Рет қаралды 370,718

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

Пікірлер
@Historyiswatching
@Historyiswatching 2 жыл бұрын
I've watched sooooooooo many KZbin tutorials - this guy is legit the best teacher I've come across so far! Very clear. Thank you so much Alvin
@ragsbigfella
@ragsbigfella 3 жыл бұрын
I love Alvin's way of teaching. I loved his Dynamic programming video. Please ask him to make some more videos like Graphs and Trees.
@spaceface2288
@spaceface2288 3 жыл бұрын
He already made videos on those topics bruh
@veganaiZe
@veganaiZe 3 жыл бұрын
Graphs: kzbin.info/www/bejne/aJC4ppyuqchon5I
@calebo.a.6270
@calebo.a.6270 2 жыл бұрын
Same here
@mehulsolanki9435
@mehulsolanki9435 2 жыл бұрын
@@spaceface2288 He's going to love them.
@maozbenkalif598
@maozbenkalif598 2 жыл бұрын
08:25 one small correction, the order of inserting a node to a linkedlist is that the node you wish to enter has to point first to the node and then you have to take node b to point on node q, if you start by pointing b to q first you will lose all the data of c and d. Great video !! loved it
@ehabahmedyassen
@ehabahmedyassen Жыл бұрын
yup, q.next = c then b.next = q
@m.y.7230
@m.y.7230 10 ай бұрын
Hands down the best explanation for linked list. It finally clicked on me after 3 days banging my head against the wall. His algorithms are way more intuitive, both iterative and recursive versions, much much more than what other instructors talked about. Thank you!
@EnriqueMoranG
@EnriqueMoranG 3 жыл бұрын
Bro you explain so good that i've been able to perform the tasks without watching the whole video. Just got the idea and solved it by myself. I love you, Alvin. Happy New Year, mate!
@aliqyan9827
@aliqyan9827 11 ай бұрын
same!
@Jamesxoxo89
@Jamesxoxo89 2 жыл бұрын
Started learning linked list this week and could not understand the code for it at all until this video... Super appreciative, this community exists.
@chukwunta
@chukwunta 2 жыл бұрын
This is all you need to learn about linked-list. This is my fifth time viewing and I always seem to comeback and learn something new. It is such an amazing resource. Thanks @Alvin
@morenomt27
@morenomt27 2 жыл бұрын
Thank you for this Alvin. I had a hard time refreshing linked list by watching countless tutorials and I can't understand why I can't move on with problems. While you are explaining, I am able to answer problems!
@AshenafiGodana-m1u
@AshenafiGodana-m1u 6 ай бұрын
This is the only programming video I watched from start to finish with one sitting and I clearly understood LinkedList. Thank you Alvin!
@zeynepdagci1
@zeynepdagci1 2 жыл бұрын
your courses're amazing!! I have an interview with google in a couple of hour, I hope your courses work for me !!!
@fastdesigns8895
@fastdesigns8895 2 жыл бұрын
did they
@tf1n
@tf1n 2 жыл бұрын
Best video on LL’s that I’ve seen. Thank you, Teacher Alvin!
@abolfazljahangir1651
@abolfazljahangir1651 9 ай бұрын
You are amazing Alvin! I've learned a lot from you🙌
@sriram-uu6yd
@sriram-uu6yd 3 жыл бұрын
Trust me, I was searching for an hour yesterday to find a good resource to learn Linked Lists. Thank you, FCC.
@AnkurSharma-hf9jn
@AnkurSharma-hf9jn Жыл бұрын
Best explanation ever Now I'm much more confidence writing link list problem.
@RahulD600
@RahulD600 3 жыл бұрын
I love Alvin's way of teaching! He's really a master! Thank you very much!
@Pupu._
@Pupu._ 2 жыл бұрын
Alvin is so to the point and voice is good to hear 🙌
@talios6824
@talios6824 10 ай бұрын
Absolutely the best tutorial video on linked lists. Thank you so much, Alvin! Fantastic teacher.
@skitzhills
@skitzhills Жыл бұрын
Alvin you are the best programming sensei. This Linked List tutorial is just ridiculously good...
@pankkajsen
@pankkajsen 3 жыл бұрын
Given a blind like because of Alvin👍…and added to my “Immediate watch” list 😀
@Luke-gr6dg
@Luke-gr6dg 11 ай бұрын
I love that you said "A"'s next is "B". That makes link list much easier to conceptualize than other sources which overly complicate it.
@whetfaartz6685
@whetfaartz6685 10 ай бұрын
That's exactly how I see it
@zeganikhalid9730
@zeganikhalid9730 2 жыл бұрын
man this is the best explanation ever.
@tonyseben
@tonyseben Жыл бұрын
For the iterative Zipper implementation, we need a null check for head1 (ideally for head2 as well). if(head1 === null) return head2; if(head2 === null) return head1;
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 3 жыл бұрын
seeing alvin puts a smile on my face :)
@freecodecamp
@freecodecamp 3 жыл бұрын
Same.
@omarkyon1933
@omarkyon1933 3 жыл бұрын
Really cool to see you here Alvin. Great explanations as usual
@myrusEW
@myrusEW Жыл бұрын
I just realized watching theory tutorials in other languages actually makes learning so much more intuitive, since you can't just blindly copy. You're forced to understand how your language works, and you're forced to implement those ideas without really being able to "cheat". Wow. I'm gonna start watching C tutorials and do them in python. I'm about to hit 10x developer once I understand all this
@servantofthelord8147
@servantofthelord8147 Жыл бұрын
This is a very good point. I never realized this. This whole time I was trying to avoid tutorials in different languages, not realizing that they were the key to helping my solidify my understanding. Good observation!
@madman3727
@madman3727 Жыл бұрын
same I was forced to code this in my learning language and I was surprised to see how quickly I learned
@ArudSekaBerneLearnings
@ArudSekaBerneLearnings 8 ай бұрын
I love the way he explain and able to grasp things even though I am a beginner.
@sanjaypaudel3296
@sanjaypaudel3296 2 жыл бұрын
Alvin we need more of you guys. Grow up your channel. You are a hero
@foravidalalsharma1291
@foravidalalsharma1291 2 жыл бұрын
I wish you had Java as one of the programming languages, but I still loved your course and was able to interpret everything in Java because of how you explained the algorithms, it was so simple to even understand recursive, something I always mess up. Thank you!!
@michaels7159
@michaels7159 Жыл бұрын
No
@av12-db
@av12-db 3 жыл бұрын
Your videos are awesome..Saw your video on Dynamic programming and since then i am not facing any problem in solving such questions.
@madhubalajayakumaran9340
@madhubalajayakumaran9340 2 жыл бұрын
loved the explanation! Though I knew all these concepts before, I just watched anyway.
@pauzhou8639
@pauzhou8639 Жыл бұрын
omg who is this guy? He has the best algor interview videos !!
@andiuptown1711
@andiuptown1711 4 ай бұрын
Alvin! Ex Google engineer. He also put out a new React + Tailwind course
@doctype7430
@doctype7430 2 жыл бұрын
I like the way Alwin simplifies the concepts and problems. learnt a lot. Thanks
@shyamprakashm6325
@shyamprakashm6325 3 жыл бұрын
What a co-incidence .tomorrow we have a amazon technical interview , hope It would help.
@sampathsai5509
@sampathsai5509 3 жыл бұрын
I love the way you teach 😍. Please create a course on Backtracking.
@thelastminutetrade
@thelastminutetrade 3 жыл бұрын
Bro your research and best way of analysis is amazing. Who else find this list helpful ❣️❣️
@sculptscript
@sculptscript Жыл бұрын
9:07 Linked list insertion at an index which is not at the head or the tail should be O(k) Time right?
@Jutastre
@Jutastre 6 ай бұрын
Yup, and because you're hopping through so many pointers, you get a lot more cache misses than an array, more often than not making it slower than an array in practice.
@vaibhavpathak786
@vaibhavpathak786 3 жыл бұрын
Thanks!
@CHITUS
@CHITUS 3 жыл бұрын
Bro your research and best way of analysis is amazing. Who else find this list helpful ️️
@andr3w321
@andr3w321 8 ай бұрын
@1:21:40 Unless I'm missing an edge case, there's no need for the count variable in the iterative zigzag solution. Just move tail twice in each while loop. C++ code below Node* zigzag3(Node* head1, Node* head2) { Node* tail = head1; Node* cur1 = head1->next; Node* cur2 = head2; while(cur1 && cur2) { tail->next = cur2; cur2 = cur2->next; tail = tail->next; tail->next = cur1; cur1 = cur1->next; tail = tail->next; } if (cur1) tail->next = cur1; if (cur2) tail->next = cur2; return head1; }
@sufalt123
@sufalt123 4 ай бұрын
this was my solution: template Node* zipper(Node* head1, Node*head2) { auto current1 = head1; auto current2= head2; while(current1 != nullptr && current2 != nullptr) { auto next1 = current1->next; auto next2 = current2->next; current1->next = current2; current2->next = next1==nullptr?next2:next1; current1=next1; current2 = next2; } return head1; }
@michaelkofron3994
@michaelkofron3994 Жыл бұрын
Why at 30:53 does he create a new function for the recursive version? Why is he afraid of creating multiple arrays when JS arrays are pass by reference?
@eshw23
@eshw23 2 жыл бұрын
Amazing, this guy is dynamic and engaging
@Guru_Bloke
@Guru_Bloke 2 жыл бұрын
Thanks. This is top notch. On my way to subscribe. Frankly best content ever. Quick and eloquent.
@gautamgunecha5963
@gautamgunecha5963 3 жыл бұрын
His tutorial are pure 💎
@sane7263
@sane7263 2 жыл бұрын
I think it's much elegent this way. Anyway it was superb tutorial, Thanks Alwin! node *ZippedLL(node *A, node *B){ if(!A) return B; if(!B) return A; node *ptrA = A; node *ptrB = B; while(ptrA && ptrB){ node *nextA = ptrA->next; node *nextB = ptrB->next; if(ptrB) ptrA->next = ptrB; if(nextA) ptrB->next = nextA; ptrA = nextA; ptrB = nextB; } return A; }
@nonconsensualopinion
@nonconsensualopinion 2 жыл бұрын
At least one error you will get is that you will be stuck in a loop. ptrA and ptrB are pointers and not booleans. Their values will likely be non-zero which will be interpreted as true. You need " While (ptrA != nullptr &&...) ". Something like that. Here is my code which I think works how you intended. /// Assumes that neither list is empty. void * zip(Node* f, Node* s){ while(f != nullptr && s != nullptr){ // Save next pointer. Node* n = f->next; // Point element from this list to other list. f->next = s; // Update first and second node. f = s; s = n; } }
@sane7263
@sane7263 2 жыл бұрын
@@nonconsensualopinion it works the way it is intended, NULL will be treated as false. Your code it correct, but I am not quite sure where am' wrong
@andreytsapko4213
@andreytsapko4213 2 ай бұрын
Best explanation of LinkedList ❤
@tomashoracek7187
@tomashoracek7187 11 ай бұрын
Awesome vids helping me with my uni subject Foundations of Programming, they give us 15 small programming exercises every week for points that count to final mark and also credit and they gave us exercises such as programm ringbuffer using linked list, program queues and stack using linked list. Merge two ordered linked lists and so on xd
@Sz-hi7wj
@Sz-hi7wj 3 жыл бұрын
welcome back Alvin!
@rashidselemani475
@rashidselemani475 2 жыл бұрын
The way you explain the link list, even a foolish can understand it. Thanks a lot 😊
@eda-un8zr
@eda-un8zr 2 ай бұрын
Awesome. Alvin is a great teacher
@stanleyjekwu6810
@stanleyjekwu6810 2 жыл бұрын
The best I have seen so far...Thank you so much... I just checked your platform to make a purchase to go deeper but I couldn't find C# language option (that's my core language). I don't know if there will be room for that in the future? I greatly benefited from this JavaScript version.
@nathanexclusive9261
@nathanexclusive9261 2 жыл бұрын
The way Alvin teaches linked lists makes these concepts NOde big deal. Haaa
@japarjarkynbyek8494
@japarjarkynbyek8494 Жыл бұрын
Love it as always! Big kudos!
@saplay3372
@saplay3372 3 жыл бұрын
All the members of your department are great
@heybibleefan
@heybibleefan Жыл бұрын
BEST LINKEDLIST VIDEO EVER
@alexbolych2366
@alexbolych2366 10 ай бұрын
Thank you very much. The best explanaition of js linked lists
@sandeepchandupatla7832
@sandeepchandupatla7832 Жыл бұрын
Completed watching this tutorial, very informative, thanks a lot 🎉😊
@johnnyf1624
@johnnyf1624 2 жыл бұрын
i rlly like the way you explain the problem step by step.
@bruhmoment3731
@bruhmoment3731 2 жыл бұрын
what an excellent teacher!
@iamlookto
@iamlookto 3 жыл бұрын
Realy nice teaching style. Just one question. @ 37:00 it says the space is O(n) for the recursive sumList function. That is true for how it is implemented. But couldn't we also achieve O(1) by passing the sum variable into every recursion like it's done with the recursive linkedListValues? Wouldn't hat be much more optimised?
@atharvarane6165
@atharvarane6165 3 жыл бұрын
From what I understand, space complexity of O(n) means, in the worst case there will be 'n' call stacks ( i.e when we reach the tail of the linklist), thus passing the integer as a argument will still create n call stacks, hence O(n).
@iamlookto
@iamlookto 3 жыл бұрын
@@atharvarane6165 then why is it different in the recursive version of linkedListValues?
@atharvarane6165
@atharvarane6165 3 жыл бұрын
@@iamlookto Must be a mistake, because the memory complexity is determined by the number of return statements because each function call will be stored on the program stack. To generalize, a recursive function's memory complexity is O(recursion depth). As our tree depth suggests, we will have n total return statements and thus the memory complexity is O(n).
@kuxnal
@kuxnal 2 жыл бұрын
The video that I had been searching. Thank you so much
@saurabhnambiar5514
@saurabhnambiar5514 3 жыл бұрын
The Dynammic programming one was a blockbuster hence m here cheer
@rebeccaburch3334
@rebeccaburch3334 2 жыл бұрын
for zipperlist iterative approach, when you add the rest of the list that is leftover tail isn't reassigned to be the new tail. In this case, you're just using "tail" as a pointer to the current end of the constructed list. And tail isnt assigned at all in the recursive solution. Would there be an extra step to iterate through the leftover list to the end and reassign tail? Thanks for your great videos 🔥🔥🔥
@georgeimus6102
@georgeimus6102 10 ай бұрын
not gonne lie thought this video was gonna be a waste of my time but I learned linked lists in just the first 15 mins of the video and was able to swift by these easily.
@kamaboko1
@kamaboko1 2 жыл бұрын
Hands down the best algorithm explanations. $ Structy purchase.
@ahmedhamdytube
@ahmedhamdytube 2 жыл бұрын
Alvin you are a great teacher.
@DrewOsmond
@DrewOsmond 3 жыл бұрын
Great video Alvin!
@hi-tk4hu
@hi-tk4hu 2 жыл бұрын
Best video on LL for beginner
@sufalt123
@sufalt123 4 ай бұрын
kinda cool that i found different (tho worse) solutions to some of the problems on my own :D
@kehinde10100
@kehinde10100 2 жыл бұрын
Best teacher ever!!!
@mishkathossain2984
@mishkathossain2984 3 жыл бұрын
Alvin the boss is back in the hood!!!!!!
@abdulwakilabdulkadir8288
@abdulwakilabdulkadir8288 2 жыл бұрын
My comment may not matter much, but this video is amazing. I have to say
@sharangkulkarni1759
@sharangkulkarni1759 2 жыл бұрын
last zipper recursion was awesome beauty
@PrashantNigam
@PrashantNigam 3 жыл бұрын
My dude is back!!!
@jimmykitty
@jimmykitty 3 жыл бұрын
As Always, Thanks a Trillion..... ♥️♥️♥️♥️♥️♥️♥️♥️🌿🌿🌿🌿🌿🌿
@ayushmishra6740
@ayushmishra6740 9 ай бұрын
Smooth Explanation.
@dev-skills
@dev-skills 2 жыл бұрын
19:15: great advice not to premature checking on linked list
@intcoder
@intcoder 2 жыл бұрын
Awesome Video!!! thanks for the detail explanations.
@eidmone8684
@eidmone8684 3 жыл бұрын
ALVIN the GOAT!
@gunratnamore
@gunratnamore 3 жыл бұрын
Helpful always 👍
@mrrishiraj88
@mrrishiraj88 3 жыл бұрын
True
@ankit-h8470
@ankit-h8470 3 жыл бұрын
@@mrrishiraj88 This_Reply = True;
@TheManBehindTheScen1
@TheManBehindTheScen1 10 ай бұрын
My Recursive Solution for Zipper List is MORE concise and easier to learn: const zipperLinkedListRec = (head1, head2) => { if (!head2) return; let temp = head1.next; head1.next = head2; zipperLinkedListRec(head2, temp); return head1; }; *This assumes that both lists are non-empty like in video
@sufalt123
@sufalt123 4 ай бұрын
cooooooooool
@AlThePal78
@AlThePal78 2 жыл бұрын
this is literally the best video I seen on this. However, you said it can be anything in the data. However, in C# and Java would be different. it would have to be what you choose it to be because you have to initialize the type of data it has to enter so all the nodes would have integers. Am I right or am I wrong?
@dzni9061
@dzni9061 2 жыл бұрын
you have saved my life
@vishaloza6981
@vishaloza6981 3 жыл бұрын
thank you! needed this video!
@johnbright8172
@johnbright8172 2 жыл бұрын
Thank you so much. You're the best!!!!
@ehabahmedyassen
@ehabahmedyassen Жыл бұрын
I solved ZipperList iteratively without a counter to toggle between the two lists because at the start, i position the tail at the end of the initially constructed zipped list then within the while loop i construct the next node as a linkedlist of two nodes (current1.val) -> (current2.val) and then i update the tail and set the constructed two-nodes-list as its next then i refer to the last node of two-nodes-list i have just added as the new tail. private static Node zipListsIterative(Node head1, Node head2) { Node zipped = new Node(head1.getVal(), new Node(head2.getVal())); Node tail = zipped.getNext(); Node current1 = head1.getNext(); Node current2 = head2.getNext(); while (current1 != null && current2 != null) { Node next = new Node(current1.getVal(), new Node(current2.getVal())); tail.setNext(next); tail = next.getNext(); current1 = current1.getNext(); current2 = current2.getNext(); } if (current1 == null) tail.setNext(current2); if (current2 == null) tail.setNext(current1); return zipped; } and recursively, i wrote the recursive case as one liner by making use of the constructor: Node(String val, Node next) private static Node zipListsRecursive(Node head1, Node head2) { //base cases if (head1 == null && head2 == null) return null; if (head1 == null) return head2; if (head2 == null) return head1; //recursive case return new Node(head1.getVal(), new Node(head2.getVal(), zipListsRecursive(head1.getNext(), head2.getNext()))); }
@havefun5519
@havefun5519 3 жыл бұрын
Thanks man, your recursive method is great
@havefun5519
@havefun5519 Жыл бұрын
2nd watched.
@havefun5519
@havefun5519 Жыл бұрын
Last zipper recursive method is not easily to understand.
@alexroy4235
@alexroy4235 2 жыл бұрын
Excellent explanation
@rem.kudusov
@rem.kudusov Жыл бұрын
Thank you, bro!
@monadastar9393
@monadastar9393 2 жыл бұрын
great help! thank you
@Singh54321
@Singh54321 Ай бұрын
learned trees now this thanks man
@banjohead66
@banjohead66 3 жыл бұрын
I believe that it was David Seville who so famously said ALVIN!
@mohamedtaherali8914
@mohamedtaherali8914 Жыл бұрын
i think insertion in time complexity is O(n) in worst case this is most significant for linked list because we cant reach index till we reach the previous one and so on .. that's right ?
@LongDistance22
@LongDistance22 2 жыл бұрын
You teach better than majority of my professors. Why couldnt you be my professor? Why am i stuck with spoiled professors that have no passion for teaching and explain bad
@orangekitty5192
@orangekitty5192 2 жыл бұрын
Great teacher!
@teodora_cassualo
@teodora_cassualo 2 жыл бұрын
best teacher :DD
@79Nardo
@79Nardo 3 жыл бұрын
Excellent!
@parmachine470
@parmachine470 Жыл бұрын
Do you just use a wrapper function in your course when you have visited or memo?
@sohamali7018
@sohamali7018 2 жыл бұрын
Thankyou Very Very Much🙂🙂🙂🙂🙂🙂
@sergiocayuqueov
@sergiocayuqueov Жыл бұрын
Good job.
@gopalks6437
@gopalks6437 3 жыл бұрын
Amazing !
Top 6 Coding Interview Concepts (Data Structures & Algorithms)
10:51
LinkedList vs ArrayList in Java Tutorial - Which Should You Use?
11:43
Coding with John
Рет қаралды 617 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Why You Should AVOID Linked Lists
14:12
ThePrimeTime
Рет қаралды 284 М.
Binary Tree Algorithms for Technical Interviews - Full Course
1:48:53
freeCodeCamp.org
Рет қаралды 745 М.
Linked Lists - Computerphile
10:11
Computerphile
Рет қаралды 206 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 850 М.
How I Got Good at Coding Interviews
6:29
NeetCode
Рет қаралды 1,7 МЛН
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 1,1 МЛН
Fastest way to learn Data Structures and Algorithms
8:42
Sahil & Sarra
Рет қаралды 310 М.
Software Engineering Job Interview - Full Mock Interview
1:14:29
freeCodeCamp.org
Рет қаралды 1,6 МЛН
Linked List Data Structure | JavaScript
29:36
Traversy Media
Рет қаралды 212 М.