Linked Lists for Technical Interviews – Full Course
January 15, 2025 2025-01-15 4:03Linked Lists for Technical Interviews – Full Course
Learn how to solve linked list problems for coding challenges and interviews.
✏️ This course was developed by Alvin Zablan from Structy. Check out his channel: https://www.youtube.com/c/AlvinTheProgrammer
🔗 Study more data structures and algorithms with Alvin in his complete course: https://structy.net/
⭐️ Course Contents ⭐️
⌨️ (0:00:00) Course Introduction
⌨️ (0:01:09) What is a Linked List?
⌨️ (0:09:22) Linked List Traversal
⌨️ (0:23:36) Linked List Values (https://structy.net/problems/linked-list-values)
⌨️ (0:33:10) Sum List (https://structy.net/problems/sum-list)
⌨️ (0:42:31) Linked List Find (https://structy.net/problems/linked-list-find)
⌨️ (0:51:03) Get Node Value (https://structy.net/problems/get-node-value)
⌨️ (0:59:32) Reverse List (https://structy.net/problems/reverse-list)
⌨️ (1:09:50) Zipper Lists (https://structy.net/problems/zipper-lists)
🎉 Thanks to our Champion and Sponsor supporters:
👾 Raymond Odero
👾 Agustín Kussrow
👾 aldo ferretti
👾 Otis Morgan
👾 DeezMaster
—
Learn to code for free and get a developer job: https://www.freecodecamp.org
Read hundreds of articles on programming: https://freecodecamp.org/news
source
Comments (31)
@ab11op78
Best Video
@theencryptedpartition4633
bbro why Java Script lmaoooooo
@Singh54321
learned trees now this thanks man
@eda-un8zr
Awesome. Alvin is a great teacher <3
@andreytsapko4213
Best explanation of LinkedList ❤
@АлександрРусаков-в4с
Martin Carol Wilson David Martin Ruth
@rodneygodwin4861
This was a very helpful video! Thanks FCC and Alvin.
# Python
def zipper_linked_list(head1, head2):
tail = head1
next_node = head2
while next_node:
current_node = next_node
next_node = tail.next
tail.next = current_node
tail = current_node
@sufalt123
kinda cool that i found different (tho worse) solutions to some of the problems on my own 😀
@AshenafiGodana-m1u
This is the only programming video I watched from start to finish with one sitting and I clearly understood LinkedList. Thank you Alvin!
@jrumac
i love you alvin
@zfarahx
Thanks!
@andr3w321
@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;
}
@ArudSekaBerneLearnings
I love the way he explain and able to grasp things even though I am a beginner.
@ayushmishra6740
Smooth Explanation.
@abolfazljahangir1651
You are amazing Alvin! I've learned a lot from you🙌
@nicolascanala9940
Deez' next
@TheManBehindTheScen1
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
@m.y.7230
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!
@mullercw2010
Whenever he says D’s->next I mouth the words ’Deez Nutz’
@talios6824
Absolutely the best tutorial video on linked lists. Thank you so much, Alvin! Fantastic teacher.
@georgeimus6102
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.
@alexbolych2366
Thank you very much. The best explanaition of js linked lists
@Luke-gr6dg
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.
@tomashoracek7187
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
@krishnanigalye1173
My solution to zipperlist accepted by structy.
const zipperLists = (head1, head2) => {
if(head1 === null) return head2;
if(head2 === null) return head1;
let current1 = head1, current2 = head2, next1 = null, next2 = null;
while(current1 !== null && current2 !== null) {
next1 = current1.next;
next2 = current2.next;
current1.next = current2;
if(next1 !== null) current2.next = next1;
current1 = next1;
current2 = next2;
}
return head1;
};
@sculptscript
9:07 Linked list insertion at an index which is not at the head or the tail should be O(k) Time right?
@mouadouad1656
I have thought of another way to do zipper lists recursively, that for me looks more elegant. Maybe it is already known, but I felt good when I stumbled on it alone 😂
def recursive(head, tail):
if head is None:
return tail
head.next = recursive(tail, head.next)
return head
@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 ?
@kirillzlobin7135
51:05
@wenkaiyang1487
what does a.next mean? I don't get it why this.next = null can be created. what does this .next help with?
@prashanthrapaka5762
steve jobs