Top 7 Data Structures for Interviews Explained SIMPLY
Вставка
- Опубліковано 20 тра 2024
- Data structures are an essential part of software engineering, whether for interviews, classes, or projects.
Today we'll be talking about the 7 most important data structures, and explaining them in the simplest way possible. We'll be covering explanation of the data structure, common uses, and time complexity for those familiar with it.
📘 Chapters
0:00 - Intro
0:40 - Arrays
2:44 - Linked Lists
4:29 - HashMaps
6:00 - Stacks
7:06 - Queues
8:10 - Trees
10:28 - Graphs
🔗 Resources
Icons created by Freepik - Flaticon: www.flaticon.com/free-icons/i...
🎵 Music
Music Courtsey of Epidemic Sound
Wizzle - Guustavv
Slapperoni Pizza - Jobii
Unfettered - Jobii
At My Own Pace - Sarah, the Illstrumentalist
Deadlines - Dylan Sitts
Sleepy + Hungry - baegel
#datastructures #coding #softwareengineer - Наука та технологія
This is the first video I’ve added background music to - please let me know if you enjoyed it, or if you have any other feedback!
I definitely like the music, I've found that silence in the background can lead to me getting bored more quickly for some reason
@@frosty_teacup Awesome I’m glad to hear that! (not the bored thing, the music helping thing 😂)
Music is perfect
First video I've seen from you and awesome job man very helpful. Music is perfect, I appreciate it being subtle and your voice is still clear to hear
Thank you so much for your vidoes. I like the videos without music .
Dude you f nailed it! The well made graphics of the video, along the real life examples are top tier! Couldn't explain better!
This is amazingly explained and the examples you give are also very helpful. Thanks a lot!❤
Love the analogies that you use to explain the Data structure concept. Thank you 🙏🏾
Man the way you explain this and with the visualization was just perfect ! , I'm going to keep referring back to this video as I learn DSA thank you !
This was amazing, an incredibly dull topic, explained so well. Kudos!
IF ONLY I HAD FOUND YOU SOONER .. this was so simply explained!!!! Subscribed right away!
you got a good clear voice ,you use simple English words most of the non native English speakers gets hard to cope up with native English speaker's tutorials and there is no point of seeing the content in native language due to bad quality ,you are maintaining both ,and the best thing is you use *simple examples* ,which are not region specific , so we all get it easily, make more dsa videos and put them in sequence wise ,easy to find, perfect animation ,no extra content on screen
Thanks so much! Making a Top 7 Algorithms video in the same style :)
so far you are the best to explain those concepts. Keep Up!
You are so clear and concise. Thank you for making this video.
How tf do you only have 21k dude this is the best video on data structures I’ve ever seen!!!
I just told myself the same thing. His videos are informative and well-produced.
Straightforward and simple! Thanks I enjoyed the video.
All of these videos have been super helpful so far, and this one convinced me to subscribe. Thank you for providing this resource!
You’re welcome! Thank you for the kind words! I’m glad this one was able to convince you to stick around :)
Love it! Thanks for your effort. This is video is diamond 💎
Yeah thank you bro for this video. I just starting my course in Algorithm Analysis and Design, so this video was a helpful refresher. Those are the exact same data structures in the course (Bachelor's Degree Level)
Thanks a lot. The video was awesome. Never lost focus for a single second. I can imagine how much effort you've put into it. Keep it up.
Thanks so much! It’s honestly so much effort haha people don’t realize. I didn’t even realize until I started. This video took around 12 hours to bring to completion, from scripting to recording audio to making video graphics and then editing everything together. I appreciate comments like these, makes it all worth it! :)
Good work! Just what I needed a very 'simple'...and, also, perfectly understandable...explanation of an, otherwise, very 'complex' subject. Well done! Thanks! ;-)
Very helpful, thanks! Can't wait for more videos! Keep it up!
Great video! Love the content :)
The graph expression is amazing and easy makes sense
I often heard about hash maps, now i get it that is simple a key value pair, like dictionaries or Json.
Your content is underrated man. Click the video thinking this was some 100k views video about DS. The effort you put in this one is fantastic. The way you explain the concepts visually helps me understand a lot faster. You gain a new sub today. Hope to see more and more of you.
Thanks so much! I’ll keep making content to keep helping people out :)
Thank you. Best explained🥇. After long time I just clicked on bell icon.
Awesome, thank you for all the great work!!!
This content is pure gold. Suscribed.
Thank you! Your videos are top-notch. I'd love to see you make a complete paid course on teaching data structures and algorithms in Python. This would be really valuable for the community since there aren't many good courses on DSA (sadly).
Explained really beautifully ❤
Simple explanation and the pace is slow enough to process the information comfortably. I have watched countless of vids on data structures and this is by far my favourite. Great work!!
This.
Go go data structures! Nice video, keep it up.
Thank you so much for this! Can’t wait for more!
Thanks for the kind words! More coming soon :)
thanks for ur videos, they are well made and easy to understand!
this channel deserves a million subs
Thank you for your videos! I'm about to be a freshman CS major and starting to learn Data Structures and Algorithms for software engineering interview prep. I would love to see videos on standard algorithms and go in-depth about major data structures and algorithms!
I have all of those in the works! Everything you need for software engineering interviews, I have you covered! :)
@@Codebagel Sounds amazing! Looking forward to them!
Love your content man! Hope to see more from you.
Thanks so much Exstra! Follow up video to this one (Top 7 Algorithms for Interviews) coming in the next few days!
This video is very helpful for basic theory of DSA
thank you very much for wonderful content and explanation
keep it up sir
greetings from Yemen
I’ve never subbed to someone this quick.
indded we want more dsa videos , explanation with example u naild it !!
I'll make sure to keep making them! Thanks for the motivation!
Great Work, very useful !! Can't wait for the detailed videos.
Thanks! First one coming next week!
Thank you for explanation and channel as it is helping me understand data structures as I am doing Python. I would love to see some coding examples using data structures. Otherwise, keep up the good work
5:31, the realization caught me.
Wow, what a concise and informative breakdown of the top 7 data structures! 📚💻 Codebagel really knows how to simplify complex concepts for us. From arrays to graphs, each explanation was clear and easy to understand. Thanks for providing such valuable insights into data structures essential for interviews, classes, and projects. Can't wait to implement this knowledge! 👏🚀 #datastructures #coding #softwareengineer
Amazing. Thank you. Is there a play list going over each in depth?
excellent basic summary
Amazing video !!! keep up the great work learned alot and love the backgroudn music !!
Thanks dude! You’re gonna hit 100 soon, everyone go sub to this guy^!
@@Codebagel haha i appreciate you !!
Thank you so much ❤️
Thank you 🙏
Thank you!
Excellent explanation! Great quality also!
Thanks so much!
Fantastic Video buddy
Hey man, I'd love to see more videos about data structures. Perhaps with some code examples and a little more in-depth descriptions of memory allocation for each, if at all possible. Maybe dedicating entire videos to a single data structure would do the trick? And then later have a playlist for data structures? I really loved the way CS50's intro to data structures was taught. This is an incredibly important topic for me, being mostly self-taught and trying to solve programming problems everyday. I wish I studied CS in undergrad... but videos like these make it a little more bearable. Thanks for your hard work!
Oh and I'm especially interested in graphs now... hahaha
I plan on making videos for every data structure with code examples, solving problems with them, and memory allocation more in-depth!
@@Codebagel Legend!
Can i say one truth ? This guy teaches data structures well than my data structure teacher in my college😂❤
This is a masterpiece, love ya videos ❤️
Thanks so much Dazle! I’ll keep trying to make great content!
Hi. A very good video. At 2:57 you mentioned LinkedLists had O(1) for a deletion operation. How would that be the case if you have to start from the first node and traverse linearly until you find the node you want to delete? I think a deletion is O(n), same as a read.
learned more from you than my data structures course haha
thanks, very useful
Thanks!
This was very good. Please do more of these
Thank you, I will!
23.1K SUBS! U DESERVE MORE!
Thanks so much! Hopefully 50k soon! :)
And thanks to you also buddy for such a quality content.
You’re welcome! Thank you for the support :)
Thank you
Great video, Mr. Bagel!
Thank you, Mr. Wellman!
Amazing explanation. Where can i find the in depth videos on each of the data structures.
You will rock my brother soon!!!!! Keep Going.
Thank you! I’ll keep making content don’t worry!
Found you on reddit ... Loving the video. Subscribed.
Thank you!
@@Codebagel More tree videos please. DFS, BFS, Heaps would be really helpful.
you are simply the best please do algorithms as well
Algorithms video should be coming up in the next week or so!
No one refers to the child nodes as `leaves' the leaves are the terminal nodes. In other words the nodes with no children.
Whay did you use to make the graphics?? Nice video
8:40 the most top parent node is also called the ROOT and the last children on the very bottom which dont have any other nodes connected to them are called LEAFES.
Why did not I find this video sooner !!!
Data Structures:
Arrays:
- Read: O(1)
- Insertion: O(n)
- Deletion: O(n)
- Fast at reading but slow at insertion and deletion.
Linked Lists:
- Read: O(n)
- Insertion: O(1)
- Deletion: O(1)
- Slow at reading but efficient for insertion and deletion.
HashMaps:
- Read: O(1)
- Insertion: O(1)
- Deletion: O(1)
- Similar to arrays but with named indexes (keys); unordered but provide fast lookup.
Stacks:
- Push: O(1)
- Pop: O(1)
- Peak: O(1)
- Follow the LIFO (Last In, First Out) principle; useful for fast retrieval of the topmost element but can be cumbersome for inserting or deleting elements in the middle or end.
Queues:
- Enqueue: O(1)
- Dequeue: O(1)
- Front: O(1)
- Follow the FIFO (First In, First Out) principle; the first element in line is the first to come out. Think of them as playlists for organizing items in order of arrival.
Trees:
- Read/Search: O(log n)
- Insertion: O(log n)
- Deletion: O(log n)
- Nodes connected by edges; root, parent-child connections.
Binary Trees:
- Efficient searching of ordered values.
- Follow a binary search property where left child nodes are less than the parent and right child nodes are greater.
- Useful for tasks like number guessing games or dictionary implementations.
Graphs:
- Traversal/Search: O(V + E) (V: number of vertices, E: number of edges)
- Insertion: O(1)
- Deletion: O(1)
- Versatile models for connections between nodes and edges; can be directed or undirected with no neighboring limit. Can include cycles and weights on paths. Used for tasks like route optimization.
Bro, why didn't you come to me when searching for the course? This video is the clearest and most useful one.
great. keep going man.
Thank you!
This was very good and very easy to understand. Wish they taught it this way in college.
Thanks so much! I’ll keep making videos like this to help everyone who needs it!
@@Codebagel That's awesome. Ill keep an eye out!
In the linked lists example, you show a diagram where the data is stored with a finite number of spots in between items. What would happen if I tried to insert in between two items right next to each other?
Linked List: 5 _ _ 4 3 _ 8
Insert 6 in the 2nd spot (starting from 0)
Would it be slower? And would it shift everything after the insert space by one until there is an empty space, or would it shift everything back more to create extra space?
Also, nice video.
Are you trying to insert the 6 between the 4 and 3?
Ultimately it doesn’t matter where you store the new 6 in memory. The whole advantage of linked lists is items don’t need to be next to each other. You can store the 6 somewhere else, and have the element before it point to it.
So if the current linked list (the one you gave) is like this: 5 -> 4 -> 3 -> 8
You can store the 6 somewhere else in memory, and have the 4 now point to it:
5 -> 4 -> 6 -> 3 -> 8
Does that clear up your question? If not, please feel free to explain and I’ll definitely try and help!
@@Codebagel Yea, that makes much more sense now. Thanks for clearing up that items can be stored anywhere.
@@alvinkim9800 No worries, always up to help clear things up where I can!
couple of months ago, I stumbled upon some very bad blog entries about data structures; though list of data structures was almost the same, the way you present is at least intelligible; I don't know why what you do isn't a widespread norm; this video deserves more attention for at least being correct (sounds kind of sad, but yes, IT education is still in a state where bad content is too easy to find);
Thank you! That’s why I chose to make this style of video, because I found I was struggling with the same issue as well.
Very great explainations
Thank you!
Nice
You nailed it. Can you make more of such videos on DSA
Definitely! I’ll be making videos on all of them!
@@Codebagel Thanks, really appreciate your hard work for helping out.
@@spiritual5750 no worries! I’m glad people are enjoying my content! Make sure you hit the 🔔 button to turn on notifications so you see my videos when I upload next. Thanks so much!
@@Codebagel i land on your channel from your earlier videos. Already subbed and notification on. 😀
Time to code... and eat a bagel...
Easier said than done I know, but you need to produce more content.
more short infotech videos please
Definitely! Uploading 2x every week!
I am a simple person who likes simple pictures.
In order to delete something from a linked list, don’t you have to find it first? So how is deletion O(1)? I don’t understand. Someone help?
Same question
@@LinhNguyen-nh8oq ok i figured it out.
For linked list, access to first node is O(1) so deleting the first node is always O(1) [if you keep a reference to the tail, same applies for the last node]. For every other nodes in between, the deletion is O(n) because - as i said - you need to find it, in order to delete it. Other techniques might apply where you keep a reference to those nodes in between with some smart way, and then yes you can delete it in O(1) because you keep that reference. But you need to find it at least once, and this try will be O(n). Hope you 're ok with that now.
@@petersteel7735 thanks, you save me time
❤❤❤
do u play runescape by any chance
How is read complexity of array is O(1) ? It should also be O(n), isn’t it ?
read, when talking about an array means accessing an element at a specific index.
for example if we have array[1, 2, 3, 4, 5] and we go to index 3, we will get array[3] which corresponds to value 4.
You will better understand if you think about an array as a special type of hash map where keys are indexes and values are elements at those corresponding indexes.
hash_map = {
0: 1,
1: 2,
2: 3,
3: 4,
4: 5
}
As we already know accessing an element by key in a hash map is constant time operation, therefore when we go to index 3, we immediately grab 4. we are not iterating or anything like that.
searching by value in an array takes O(n) time because you need to iterate through all the elements to find the value you are looking for, but reading by "index" takes O(1) constat time.
I hope that helps.
Don't forget .... the doubly-linked list. :)
👍
5:44 thanks for.making me realise hashmap is dictionaries😂
I did the first like.
Thanks for being first!
But how do i code them in c++ =((
U don’t 🗿
11:25 you never made it did you :[
If anyone find graphs complicated, then for them trees mudt be most complicated, not graphs
If you need to watch this video before your interview to learn what in tarnation an "array" and a "linked list" are, please, don't waste my time.
I am learning dsa at the moment and your videos helped me a lot to visually understand how everything works and in simple words. Thanks a lot dude. You gained a sub 🫡
I've never hit the Subscribe and the bell button faster in my life. This was awesome! Im excited to see more in-depth videos about data structures
I’m excited to keep making videos! Comments like these are always so motivating. Thanks so much!
Thank you