Top 8 Data Structures for Coding Interviews

preview_player
Показать описание


0:00 - Intro
0:12 - Arrays
2:10 - Linked Lists
4:20 - HashMaps
6:05 - Queues
7:05 - Binary Trees
8:24 - Tries
9:47 - Heaps
11:35 - Graphs

#coding #interview #faang
Disclosure: Some of the links above may be affiliate links, from which I may earn a small commission.
Рекомендации по теме
Комментарии
Автор

Hes at Google but he doesn’t stop. A true champion!

anthonyuccello
Автор

Just landed a job at google thanks to you Neetcode! Weeks of falling asleep to your videos and studying my ass off really paid off and I really appreciate your work!

daringlybad
Автор

3:50
incorrect. insert or delete in middle of the linked list is not O(1).
you need to find the node before insert or delete it, which is O(n) for the linked list

k.i.m.
Автор

Thank you! The summer grind of algorithms starts now!

MinorsW
Автор

Hey man, I just signed an offer from Google today and I feel like I couldn't do this without you! Many many thanks for your videos!

nightmarauder
Автор

Insertion into the middle of a linked list is not constant. It’s O(N). You have to traverse the list to get to the node you want to insert. Same with deletion

hashi
Автор

A must watch for anyone grinding for tech interviews

superbmood
Автор

Technically inserting and deleting from the middle is O(N) even for linked lists, however as articles don't consider indexing time when coming up with the Big O they say it is O(1).

vipinamar
Автор

You say inserting / removing from Linked List is 0(1), but for inserting at end, won't you need to traverse the whole list, go to the end and then insert? Wouldn't that make it O(n)? Space complexity would be O(1) since we aren't creating a new linked list.

sammyj
Автор

You need to traverse the linked list to insert in the middle so it is actually O(n)

tofahub
Автор

Correction:
Removing last node in a linked list:
The time complexity of removing the last node in a linked list is O(n) and NOT O(1). To remove the last node of the linked list, we would have to traverse the linked list to the second last node (ie. node.next.next == null) and then remove the last node (ie. set node.next = null).

guptaanmol
Автор

I think u need to iterate over the linked list to know the middle(as in the size) then iterate till you find the value in the linked list

joddeveloper
Автор

I know you have already done so much could you do a series on how to determine time and space complexity

TheStrafendestroy
Автор

There are concrete like arrays and linked lists and maybe even trees and abstract data structures like graphs and hashtables..

ahmedmaa
Автор

Nice 😊 I was searching a similar content ✌🏻

universecode
Автор

I don't understand the logic for a linked list's time complexity. If it takes O(n) to access an element, how can it take O(1) to insert? Don't we need to access the element i-1 in order to change it's pointer to the new item?

ryan
Автор

After joining Google, how do you manage personal time with your job?

nero
Автор

Question: May be I am missing something ? But inserting or removing at the mid of linked list how it's O(1) unless we have a reference to the mid node, which in usual scenario we don't have that reference, in that case we have to loop to find the mid node and then insert or remove in this case it won't be constant.

LokeshPandey-jk
Автор

Hey there thanks so much for your content
I really need to know the tool u use to draw on the screenshot while illustrating the problems

pinkylover
Автор

Thank you so much. Can you please make same type of video on top Algorithms.
Thanks in advance

pratikpatil