Top 7 Algorithms for Coding Interviews Explained SIMPLY

  Рет қаралды 474,279

Codebagel

Codebagel

Күн бұрын

Пікірлер: 228
@Codebagel
@Codebagel 2 жыл бұрын
Hey guys! Sorry for lack of uploads lately, hopefully this 20 MINUTE comprehensive guide to algorithms makes up for it a bit! Please like and share with friends, I worked really hard on it and want it to help lots of people!
@ReluctantSpirit
@ReluctantSpirit 10 ай бұрын
This video is one of the finest and well defined educational video on algorithms.
@ClashClash89
@ClashClash89 6 ай бұрын
Amusing footnote on the travelling salesman problem: The Japanese used a mushroom to map out an optimised solution for their railway network, by using oat flakes as „stations“, and the mycelial strings that grew the strongest where those linking the „stations“ with the shortest possible route. Bio-computer solving the problem via nutrient-gradient.
@tahirabatool2763
@tahirabatool2763 5 ай бұрын
Hello I would like to suggest something, the colors in this video were not very "popping" lets call it. In the video you have shown multiple times a binary tree where a few nodes are light purple and a few nodes are dark purple. I would like to suggest that you make the dark nodes more dark so as to make sure the color difference is able to be seen easily. You really have to concentrate to view them. Also Could you make a dedicated video to Binary Trees next? That would be a great help for me
@shadowrl7637
@shadowrl7637 11 ай бұрын
Algorithms Binary Search: - Used to find a specific element in a sorted list efficiently. - Inefficient: O(n) for linear search, incrementally guessing from start to end. - Efficient: O(log2(n)) for binary search, repeatedly dividing the search interval in half until the correct element is found. Depth-First Search (DFS): - Begins at the root node and explores as far as possible along each branch before backtracking. - Utilizes a visited array to track already visited nodes. - Continues backtracking until all nodes are visited. - Real-life example: Solving a maze by systematically exploring paths until the exit is found. Breadth-First Search (BFS): - Looks at every node at one level before going down to the next level. - Utilizes a visited array to track already visited nodes and a queue to keep track of neighbors. - Begins at the root node and adds it to the visited array and all its connected nodes to the queue, then continues to explore nodes level by level. - Real-life example: Chess algorithms predict the best move by exploring possible moves at each level of the game tree. - Runtime: O(V + E), where V is the number of vertices and E is the number of edges. Insertion Sort: - Examine’s each element in the list, comparing it with the previous elements and shifting them to the right until the correct position for insertion is found. - Simple sorting algorithm suitable for small datasets or nearly sorted arrays. - Runtime: - Best case: O(n) when the list is already sorted. - Worst case: O(n^2) when the list is sorted in reverse order. - Efficient for small or nearly sorted lists, but inefficient for large unsorted lists. Merge Sort: - A divide-and-conquer sorting algorithm that breaks the problem into smaller subproblems and solves them recursively. - Starts by splitting the array into halves recursively until each subarray consists of single elements. - Merges pairs of subarrays by comparing elements and placing them in sorted order. - Continues merging subarrays until the full array is sorted. - Runtime: O(n log(n)) in both best and worst cases, making it efficient for large datasets. Quick Sort: - A complex sorting algorithm that follows the divide-and-conquer approach and is recursive. - Selects a pivot element, ideally close to the median, and partitions the list into two sublists: one with elements greater than the pivot and the other with elements less than the pivot. - Continues the process recursively on each sublist until the entire list is sorted. - Utilizes a pivot element that is moved to the end of the list, with pointers positioned at the leftmost and rightmost elements. - Compares the elements pointed to by the left and right pointers, swapping them if necessary, until the pointers cross. - Once the pivot is correctly positioned, the process repeats on the sublists. - Runtime: - Best case: O(n log(n)), when the pivot consistently divides the list into approximately equal halves. - Worst case: O(n^2), when the pivot selection consistently results in unbalanced partitions. Greedy Algorithm: - A problem-solving approach that makes the locally optimal choice at each stage with the hope of finding a global optimum. - May not always guarantee an optimal solution but is often simple and efficient. - Real-life example: Finding the shortest path in a weighted graph using Dijkstra's algorithm, where at each step, the algorithm selects the vertex with the smallest distance from the source.
@Leonhart_93
@Leonhart_93 9 ай бұрын
Good work, works for adding to quick documentation
@ptd3v
@ptd3v 9 ай бұрын
My man
@Lu3ck
@Lu3ck 9 ай бұрын
Not all hero’s wear capes
@TarasovFrontDev
@TarasovFrontDev 7 ай бұрын
God bless you!
@chinmays420
@chinmays420 6 ай бұрын
Thanks mate you saved the day ! :)
@LenSys-AE
@LenSys-AE 3 ай бұрын
Thank you for simplifying algorithms for me! I learned a lot from you, keep up this amazing tutoring 🙏🏻
@jasonbelcher4476
@jasonbelcher4476 6 ай бұрын
I love how you put each algorithm into a use case context. That is literally the only way my interest based nervous system works. My hat is off to you sir. Keep it up.
@Redyf
@Redyf 11 ай бұрын
Code examples would help a lot too, great video
@originallyme135
@originallyme135 Жыл бұрын
This video is amazing! I was so surprised when I went to subscribe that you only had 5k subscribers, from the quality of these videos I expected at least 100k! Thank you for your awesome work, you really helped me a lot
@Gym_Halpert
@Gym_Halpert 15 күн бұрын
Great video, I’m a cybersecurity guy getting into programming concepts and I love the use cases presented for the algorithms, keep up the solid content!
@bb-xj9ed
@bb-xj9ed Жыл бұрын
thank you bro, my gf broke up with me so i have nothing but to learn algos, your video made me laugh at the greedy algo part. thank you u earned a sub
@vedagyasharma5438
@vedagyasharma5438 11 ай бұрын
stay strong brother!
@ryostyles9904
@ryostyles9904 11 ай бұрын
Great choice bro
@airman122469
@airman122469 11 ай бұрын
Sounds like you just need some greedy algos and a creative application of the traveling salesman problem. (Routes through all bars, and pickup techniques)
@kaushalrautela6
@kaushalrautela6 11 ай бұрын
Broke up and still leveling up GOD mode acticated 🤖
@wadzanaikanongovere4798
@wadzanaikanongovere4798 11 ай бұрын
Looks like someone was greedy 😂😂😂😂
@redfinance3403
@redfinance3403 7 ай бұрын
The quality of your videos is insane! Keep going, the growth of your channel is bound to happen!
@NikosS-i9d
@NikosS-i9d 3 ай бұрын
Why does this channel have only 55.6K subscribers? Dude you are a gem! Love your videos, they are very helpful!
@SMVolodko
@SMVolodko Ай бұрын
The lounge music and explanation rhythm really sets the right tempo for digesting the concepts - awesome finding!
@ngocchaunguyen1195
@ngocchaunguyen1195 11 ай бұрын
This is an incredible video. I didn't understand most algorithms as a student, because I focused on theories and code. This video helps me save time in understanding these popular algorithms. Indeed, I rarely use them in my work, it is simply because we don't have many situations to apply. I usually use linear search in JavaScript. there was a time I had a problem with sort of 10,000 objects. I have to use the binary-sort library without understanding. Once again, thanks for your video.
@largato12345
@largato12345 4 ай бұрын
just found your channel and the videos are awesome. Amazing balance between simplicity and coverage for the topics
@tamalpaul4928
@tamalpaul4928 10 ай бұрын
Brother, You gotta be my best teacher on youtube. You making lesson just the way I want. You start a topic by first being pause. Then continue with the easiest way possible. Please make more videos like these.
@durantburner7428
@durantburner7428 2 жыл бұрын
With content like this you'll be big in no time, excited for what's to come!
@Codebagel
@Codebagel 2 жыл бұрын
Thank you so much! I really appreciate the support!
@omgh8287
@omgh8287 2 жыл бұрын
I enjoyed the explanations and presentation about the different important algorithms in this video. I am subscribing to this channel in the hope of similar good content in the future. Wish you the best with growing your channel :)
@Codebagel
@Codebagel 2 жыл бұрын
Thanks so much! I’m glad you enjoyed it. Content will definitely continue to get even better, so I’m happy you’re going to stick around :)
@bigyabajracharya5681
@bigyabajracharya5681 7 ай бұрын
Commenting for the youtube algorithm! Binge watching your videos to prepare for my technical interview. VERY helpful!!
@Codebagel
@Codebagel 7 ай бұрын
Thanks so much! More coming soon 👀
@wlqpqpqlqmwnhssisjw6055
@wlqpqpqlqmwnhssisjw6055 2 жыл бұрын
You should explain how machine learning works and more of that types of videos too ,your explanation is on another level
@Codebagel
@Codebagel 2 жыл бұрын
Thanks so much! I’ll definitely tackle machine learning at some point in the near future, it’s on the list of future videos!
@danielstephengilbert
@danielstephengilbert 2 ай бұрын
Codebagel is officially my favorite DSA channel. Thank you!
@phoboslabsreviews
@phoboslabsreviews 6 ай бұрын
Bravo, the effort shows in the quality, detail and simple concise delivery.
@markost.8944
@markost.8944 4 ай бұрын
Bro, these explanations are truly great and easily digestible. Hopefully there is more to come!
@simonetumolillo9400
@simonetumolillo9400 2 жыл бұрын
I love the fact that you took the time for writing the outcome numbers of TSP in the comments haha. Nice work as always, keep it up!
@Codebagel
@Codebagel 2 жыл бұрын
Haha yeah, to me that’s such a strong way to explain why certain algorithms are used. I’m glad you enjoyed!
@rameshr4395
@rameshr4395 Ай бұрын
Fantastic presentation and explanation. Also very concise. Appreciate all your effort
@antonthordarson3610
@antonthordarson3610 9 ай бұрын
This is great, Very well explained and straight to the point. Way better than any teacher I have seen explain this..
@katurr_Real_Estate
@katurr_Real_Estate 8 ай бұрын
This is the best explained algorithm I came across
@BbB-vr9uh
@BbB-vr9uh 3 ай бұрын
Thanks for this video! I’m starting to prepare for technical interviews now, and this is a big help!
@therealzeon
@therealzeon 2 жыл бұрын
I know ur working hard my guy but keep pushing you'll breeze to 100 k by the end of the year dw 💪🧠 Keep up the amazing content man
@Codebagel
@Codebagel 2 жыл бұрын
Thanks so much! Been such a grind lately with everything going on, but definitely going to start pumping out more videos so that’s good :)
@hanshalili174
@hanshalili174 3 ай бұрын
Loving your channel bro! The examples you give are insightful.
@mitkomilev4690
@mitkomilev4690 11 ай бұрын
Good explanation, thank you. A small note for the quicksort - keep in mind that the unshift operation at 13:44 is really computational costly as you will have to unshift all elements to the left. It is better to just swap the chosen pivot element with the last one.
@tarunpanchal1902
@tarunpanchal1902 7 ай бұрын
Your representation helps me understand better thanks for you help
@Codebagel
@Codebagel 7 ай бұрын
Thank you!
@Obzrve
@Obzrve 4 ай бұрын
I’m currently taking Data Structures. So this is coming very handy.
@sujeet4410
@sujeet4410 2 жыл бұрын
I was here before this channel exploded. Keep the contents coming.
@Codebagel
@Codebagel 2 жыл бұрын
Thanks so much Sujeet! I’ll keep working towards making better and better content for you to enjoy!
@LastShade
@LastShade 8 ай бұрын
For the traveling salesman, I would use a set of controlled variables that you could programmatically cycle through to optimize results. One example would be a tolerance on overlapping routes. Cycle through 0-10 overlaps and calculate results. Compare results. As long as you keep the number of variables and variable values low, it’s a great way to squeeze out extra optimization.
@好了-t4d
@好了-t4d 8 ай бұрын
This vid is doing quite well for explaining,appreacting your hard work.
@Antariksha
@Antariksha 2 жыл бұрын
Please keep going, your explanations are on point! Subscribed.
@Codebagel
@Codebagel 2 жыл бұрын
Thanks so much!
@Mihai-LucianOprea
@Mihai-LucianOprea Ай бұрын
Thanks for the effort you put into this video!
@dabunnisher29
@dabunnisher29 5 ай бұрын
This video got me liked and subscribed. You explained this really well.
@TarasovFrontDev
@TarasovFrontDev 6 ай бұрын
Omg, that’s so cool! Outstanding work!
@i_am_spex6312
@i_am_spex6312 Жыл бұрын
Dude , you explain so well. Thank you
@arthurmorgan718
@arthurmorgan718 2 жыл бұрын
Your content is literally quality over quantity , keep the good work man
@Codebagel
@Codebagel 2 жыл бұрын
Thank you! I really appreciate it :)
@LeninMcDonalds
@LeninMcDonalds 4 ай бұрын
Love it thanks for such a clear explanation with examples . Liked and subbed
@HillelGarciaAustria
@HillelGarciaAustria Ай бұрын
Amazing video and explanations, you earned +1 subscriber
@shubhsharma19
@shubhsharma19 5 ай бұрын
Underrated channel Subbed!!
@Laby6062
@Laby6062 8 ай бұрын
A very well done sir. God bless your effort & reward you. 🙏
@voegel
@voegel 2 жыл бұрын
Thank you for this comprehensive video! 21 minutes is a good length. Btw, did your job interviews went well?
@voegel
@voegel 2 жыл бұрын
Oh and here is some advice that I think might be helpful: I know music in videos is vastly used, but mostly it‘s a bit too much. The music in this video was okay, but I actually liked the music-free videos more. They *seem* to me better structured/clean. I know this video has the same great content as always, but (maybe it‘s just me) I have problems following you. Idk, maybe I‘m wrong and using music is a good idea ^^ Just a friendly tip :)
@Codebagel
@Codebagel 2 жыл бұрын
@@voegel thank you for the feedback! I’ve been experimenting a bit with the music, but I get that it might be a bit hard to follow with it. I’m going to experiment a bit with audio levels/not including it at all, thanks for letting me know :)
@lenicholstech
@lenicholstech 6 ай бұрын
Excellent explanation!
@seannaeger9563
@seannaeger9563 11 ай бұрын
I've been trying to understand these concepts for ages. Your videos rock! Even if you spell neighbor wrong. 🙂
@yuqingpeng6523
@yuqingpeng6523 2 жыл бұрын
Very detailed explanation as always! I learnt a lot, thank you so much!!
@Codebagel
@Codebagel 2 жыл бұрын
You’re welcome! Thanks for the kind words :)
@chrisogonas
@chrisogonas 4 ай бұрын
Well illustrated! Thanks
@FaheemQazi
@FaheemQazi 11 ай бұрын
Hi, i really like the graphical representation of these topics in simple manner, however i think that @10:40 the explanation of bubble sort is mentioned as insertion sort.
@MadhuDulam
@MadhuDulam 11 ай бұрын
easy to understand bro.. great. Thanks!
@thaisb.7708
@thaisb.7708 10 ай бұрын
Amazing content, very clearly explained and the illustrations helped a lot, thank you for sharing.
@hassanriaz4274
@hassanriaz4274 8 ай бұрын
Thank you so much for this detailed video bro👊👊
@mesta3329
@mesta3329 11 ай бұрын
Great job bro. It was very interesting & easy to understant
@vasylshkrum8007
@vasylshkrum8007 11 ай бұрын
Great job, mate!
@jamesf2697
@jamesf2697 5 ай бұрын
I wish you would have just added an example code for each. But great video, keep up the good work!
@coffeewithgoutam
@coffeewithgoutam 8 ай бұрын
Explaining Data Structures with Code Examples would be more beneficial. This video is informative too.
@mohammedswiti3842
@mohammedswiti3842 6 ай бұрын
Amazing!! You helped me so much!!
@NormieDead
@NormieDead 9 ай бұрын
thank you soo much. i know this could have taken so much affrords to make .
@khndokar2382
@khndokar2382 Жыл бұрын
Love your videos ! please do more, ive learned so much
@a.rohimsama7222
@a.rohimsama7222 9 ай бұрын
Great explanation! Thank you
@ektasingh5967
@ektasingh5967 9 ай бұрын
I love all of your videos. Amazing they are. Please make videos on System Design as well.
@theartofclips895
@theartofclips895 3 ай бұрын
Where are you , its been 2 years Your videos are soo good we need more
@DavoMelendez
@DavoMelendez 4 ай бұрын
great video... straightforward explanations
@patryk5654
@patryk5654 23 күн бұрын
thats is gold, thank you!
@hemakumargantepallidataandai
@hemakumargantepallidataandai 7 ай бұрын
Like your voice, subcribed to listen it as frequently as possible.
@MeditateRelaxEtcetera
@MeditateRelaxEtcetera 10 ай бұрын
Great explanation!👍
@tony310430
@tony310430 11 ай бұрын
no hay un video que te enseñe todo, al final debemos consumir mucho contenido de calidad e intentar quedarnos con lo positivo de dicho contenido para internalizarlo y realmente poder implementarlo de manera adecuada. Este video a mi criterio cumple con el criterio de ser un video de calidad.... No comenté en inglés porque siento que los hispano hablantes que no son angloparlantes merecen también hacerse notar en las cuentas de tecnología donde usualmente solamente se habla inglés
@abyss_v
@abyss_v 11 ай бұрын
Great video, helped me a lot
@user-do8mv9ow6d
@user-do8mv9ow6d 5 ай бұрын
This video is very helpful ❤
@franciagarciaromero2589
@franciagarciaromero2589 10 ай бұрын
Loved this, please make more videos
@lintruly6269
@lintruly6269 7 ай бұрын
I start learning data science because the curiosity. I used to learn math and data structure before but I don’t know where to apply so now is different I can know.
@TrishalWalia
@TrishalWalia 9 ай бұрын
Best Explanation!
@chamarr
@chamarr 2 жыл бұрын
goated video🐐🐐
@pptmtz
@pptmtz 7 ай бұрын
Thanks, great explanation
@2gelKifissias
@2gelKifissias Жыл бұрын
I really wonder how this video hasn't blown up after a whole year
@puneetparashar2935
@puneetparashar2935 9 ай бұрын
Love your videos.❤
@rutwikpatil8491
@rutwikpatil8491 8 ай бұрын
Amazing video !!!
@ArunkumarGurram-p5x
@ArunkumarGurram-p5x 11 ай бұрын
Good work bro keep on doing 👍
@sreyakarmakar4248
@sreyakarmakar4248 11 ай бұрын
Dynamic Programming left the chat..🏃🏻‍♂️🏃🏻‍♂️ PS: amazing visuals & explanations. Thanks ❤
@bonginscandinavia
@bonginscandinavia 9 ай бұрын
Great explaination. 👍
@catarinaivf
@catarinaivf Жыл бұрын
It was really great! Thanks
@llmll6447
@llmll6447 10 ай бұрын
Very good explanation
@rondlh20
@rondlh20 9 ай бұрын
11:48 How does this sorting work in detail?
@ankiitamalik
@ankiitamalik 10 ай бұрын
Thanks🙏 very clear explanation
@Redping32
@Redping32 2 ай бұрын
Your video is so helpful!!❤❤ty
@ann.z.z.
@ann.z.z. 9 ай бұрын
Thank you so much, amazing content
@ranvirkumar108
@ranvirkumar108 Жыл бұрын
Great work men...
@greeneye360k
@greeneye360k 7 ай бұрын
master mind..great explain ever
@FaberLSH
@FaberLSH 6 ай бұрын
Thank you so much!
@voegel
@voegel 2 жыл бұрын
Hey, I‘m wondering if you are still planning to make a video about how to pass the resume screening? That might be quite interesting :)
@Codebagel
@Codebagel 2 жыл бұрын
Yes, it’s actually the next video coming out! I’m hoping to get it finished and uploaded for Monday! :)
@Codebagel
@Codebagel 2 жыл бұрын
Okay so I didn’t finish it in time for Monday haha, had 2 last minute interviews come up. It will be out by tomorrow though, guaranteed!
@YoYouWildinBro
@YoYouWildinBro 2 жыл бұрын
When I get my coding gig in the future, I'm gonna look back at these videos and think "This is why I landed this job".
@Codebagel
@Codebagel 2 жыл бұрын
Wow, you have no idea how awesome that is to hear. Thank you so much for that, and I hope I can continue to keep helping you on your journey towards breaking into the tech industry!
@kilerhg
@kilerhg 11 ай бұрын
Excelent content 🚀🚀
@hlubradio2318
@hlubradio2318 8 ай бұрын
Thanks I'll subscribe for your hard work. Now to implement them in Python.
@narekhovhannisyan6362
@narekhovhannisyan6362 Ай бұрын
nice video thanks!
@Amuzeraa
@Amuzeraa 9 ай бұрын
Thank you very much for providing time to teach us the internet strangers
@AustinHonjok
@AustinHonjok 10 ай бұрын
Man, this just helped me so much in ways I can't even explain. Took the entire time taking notes and all. Really appreciate the hard work that was put into this, like and sub from me cheers!
@AkshayRaikwar-jq6pg
@AkshayRaikwar-jq6pg 3 ай бұрын
i think i am not getting the insertion sort because you are saying that we swap the value but we swap the value in the bubble sort and in the insertion sort we catch the value of index [0] and then we compare with that value and assign the position here is the code public static int[] Insertionsort(int[] Element) { //[5,10,8,6,2,1] int n =Element.Length; for (int i = 1; i < n; i++) { int temp = Element[i]; //10 int j = i - 1; //0 while ((j >= 0) && Element[j] > temp ) // 10 >8 { Element[j + 1] = Element[j]; j--; } Element[j + 1] = temp; } return Element; }
@Raja-d6w
@Raja-d6w 11 ай бұрын
Hey! It was awesome.
@varanasikirankumar8501
@varanasikirankumar8501 10 ай бұрын
Best video ever watched
Big O in 2 Minutes
2:54
Codebagel
Рет қаралды 59 М.
Top 7 Data Structures for Interviews Explained SIMPLY
13:02
Codebagel
Рет қаралды 252 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
3 Types of Algorithms Every Programmer Needs to Know
13:12
ForrestKnight
Рет қаралды 522 М.
What staying up all night does to your brain - Anna Rothschild
5:37
Coding Interviews Be Like
5:31
Nicholas T.
Рет қаралды 6 МЛН
8 Data Structures Every Programmer Should Know
17:09
ForrestKnight
Рет қаралды 254 М.
5 Signs of an Inexperienced Self-Taught Developer (and how to fix)
8:40
Big-O Notation - For Coding Interviews
20:38
NeetCode
Рет қаралды 554 М.
I Made Sorting Algorithms Race Each Other
8:24
Green Code
Рет қаралды 269 М.
How I Mastered Data Structures and Algorithms in 8 Weeks
15:46
Aman Manazir
Рет қаралды 161 М.
How principled coders outperform the competition
11:11
Coderized
Рет қаралды 1,8 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН