3 Types of Algorithms Every Programmer Needs to Know

  Рет қаралды 423,195

ForrestKnight

ForrestKnight

Күн бұрын

It's my thought that every programmer should know these 3 types of algorithms. We actually go over 9 algorithms, what they are, how they work, real-world use cases, complete with code examples and explanations, but they fall under 3 categories, 3 types of algorithms you should know.
Sorting Algorithms - used to rearrange elements in a list or an array in a certain order. We discuss bubble sort, insertion sort, and merge sort.
Searching Algorithms - used to find or retrieve an element from a data structure, or to determine its existence and location in the dataset. We discuss linear search and binary search.
Graph Algorithms - used to solve problems related to graph theory, where data is represented as a collection of nodes (or vertices) connected by edges. You probably know these as trees. We discuss depth-first search (dfs), breadth-first search (bfs), Dijkstra's algorithm, and A* algorithm.
So, why are these algorithms you should you know? Because they form the foundation of efficient problem-solving in computer science. Their study not only enhances programming skills but also deepens analytical thinking. And they’re instrumental in optimizing software performance across a wide range of real-world applications. I hope you enjoy the video and learn a thing or two!
If you're a developer, sign up to my free newsletter Dev Notes 👉 www.devnotesdaily.com/
If you're a student, checkout my Notion template Studious: notionstudent.com
Resources🔎
visualgo.net/en
www.toptal.com/developers/sor...
motioncanvas.io/
0:00 Why algorithms are important
1:35 Sorting Algorithms
5:44 Searching Algorithms
8:06 Graph Algorithms
12:29 Want more algorithm videos?
------------------------
🖥️ Dev Notes Newsletter: www.devnotesdaily.com/
📓 Studious, Notion Template for Students: notionstudent.com
Don't know why you'd want to follow me on other socials. I don't even post. But here you go.
🐱‍🚀 GitHub: github.com/forrestknight
🐦 Twitter: / forrestpknight
💼 LinkedIn: / forrestpknight
📸 Instagram: / forrestpknight

Пікірлер: 564
@mossabDiae
@mossabDiae 2 ай бұрын
The first video I watch on your channel, subscribed in 24 seconds because you started sharing value quickly without a long unnecessary intro.
@rodoxsta
@rodoxsta Ай бұрын
Same here, but I subscribed after reading your comment!
@FernandoSLima
@FernandoSLima 10 күн бұрын
same
@lukashuth9730
@lukashuth9730 3 ай бұрын
Really nice and informative video while still being short without "unnecessary" information, i really liked it
@yourma7055
@yourma7055 3 ай бұрын
True
@softcolly8753
@softcolly8753 3 ай бұрын
The only time I have needed to implement a sort algorithm in 21 years as a software developer was for interviews or university exams. Never needed a graph algorithm at all. These are all coded into libraries these days, though it's somewhat useful to understand them, understanding how to index a database properly (applying them) is far more useful.
@gustavofagundes8994
@gustavofagundes8994 3 ай бұрын
exactly
@lukaszantoniak9046
@lukaszantoniak9046 3 ай бұрын
agree
@drakkor1000
@drakkor1000 3 ай бұрын
amen
@cbc700
@cbc700 3 ай бұрын
This was quite a nice video, especially the visuals. However, I agree with the sentiments of this thread. In three decades of coding, I've only had to implement a sort algorithm a handful of times. So rare in fact, I can't remember the last. Interesting to understand, but softcolly is right -- mostly seen in school and interviews. Your delivery is quite good -- going to check out your other vids.
@joannehart9624
@joannehart9624 3 ай бұрын
Back in the late 70s when I started coding, we often needed to implement sorting algorithms into our code. Sometimes because the operating system did not have a system sort, and other times because the overhead of setting up the code to use the system sort made it easier to just code a sort into the program. Back then CPU and memory were at a premium, so we had rules such as if the program needed to search through a table of more than 100 entries, the program had to sort the table then preform a binary search. Fun times to look back on. That said, those approaches have stuck with me throughout my career and oft times helped me fix resource heavy applications that wouldn't finish within the time frame demanded by business. 🙂
@User.Joshua
@User.Joshua 3 ай бұрын
You certainly have a knack for explaining things in an easily digestible way. Thanks.
@JustDevInc
@JustDevInc 3 ай бұрын
This was very nicely done. The visuals and your commentary allowed me to understand the algorithms in ways that previous videos I’ve watched haven’t. They’d either be too basic of an overview to get what’s happening, or too code based without visual cues to help you understand. This was a perfect balance of simplicity and depth. Great work!
@wille4986
@wille4986 3 ай бұрын
Your enthusiasm is infectious and reassuring - knowing someone else finds this all just as fascinating to dive into but presented with the quality as you do is a privilege to watch. Excellent video and I can't wait to see more! Thank you!
@Kamuisakeu
@Kamuisakeu 2 ай бұрын
The quick and concise video with visual representation together with the code sample was right on the spot! Cheers to that and give us more!
@BillyLongshot
@BillyLongshot 3 ай бұрын
love the intro and general framing of this video: no glam dreams about becoming a software engineer but the actual nitty-gritty that actually makes you one
@aggumbi
@aggumbi 3 ай бұрын
Wonderful video. As a scientist going through a programming journey, the way you show the visual and explain the code (with the highlights, etc...) is extremely helpful. More algorithm videos please! ❤
@guitarman813
@guitarman813 3 ай бұрын
One of the best videos I've seen for an introduction and basic explanation of important algorithms in computer science and programming. Awesome job! 👏
@GideonBryceTan-od4tq
@GideonBryceTan-od4tq 3 ай бұрын
Well explained and condensed -- it's like crash course for algorithms. Great stuff!
@Radio_N_Casa
@Radio_N_Casa 3 ай бұрын
Truly enjoyed this, simple enough and yet leaves me wanting more. Well done
@nitheeshraajar393
@nitheeshraajar393 3 ай бұрын
Just want to let you know @7:35, you say Binary search is O(log n) but on the chart its pointing to O(n Log n). Very nice video 👍
@jonarielmaravilla1503
@jonarielmaravilla1503 3 ай бұрын
nlogn if data is unsorted i guess.
@nitheeshraajar393
@nitheeshraajar393 3 ай бұрын
​@@jonarielmaravilla1503 then yup nlogn to sort then logn to search
@lagmaker
@lagmaker 3 ай бұрын
​@@jonarielmaravilla1503 you cant use binary search on unsorted array
@deraxelturrelkeign
@deraxelturrelkeign 3 ай бұрын
@@jonarielmaravilla1503 Binary search couldn't function (effectively) on unsorted data without sorting first. An unmodified Binary search will either find what its looking for in O(log(n)) like a normal binary search (the algorithm just happens to go the right direction), potentially falsely return -1 or I believe get stuck in an infinite loop.
@murilourso
@murilourso 3 ай бұрын
He even said "for sorted arrays"
@matias-dev
@matias-dev 3 ай бұрын
Loved the video, straight to the point with the necessary information, i had this kind of algorithms shown to me in programming classes in college and i always dread how they were shown, sometimes people overcomplicate the initial step of a bigger problem (probably not in a badly intentioned manner), i think your video is a great way to get started on these topics!
@wolfmansaw
@wolfmansaw 3 ай бұрын
I've been coding for 55+ years and I'm so glad I found you today! Great stuff!!! Right into the code and no fluff! I think you define what it means to be a programmer!!!👍
@ademromdhane1271
@ademromdhane1271 3 ай бұрын
Amazing how easy you can simplify this hard algorithms visually , good job i really like it
@flpflpflp
@flpflpflp 3 ай бұрын
Hey man, I've been a subscriber for a few years now. I think this is the content I liked the most. Keep up the great work!
@OGNord
@OGNord 3 ай бұрын
Dude this was gold. I’m currently on week 3 of CS50s course and I’m in love with C and programming so far. This is a very succinct explanation of each section! Thank you very much
@thobiaslarsen8336
@thobiaslarsen8336 3 ай бұрын
Finally someone who is happy with C and doesn't cry 😃 Thank you for showing hope 🙏
@zoeherriot
@zoeherriot 3 ай бұрын
@@thobiaslarsen8336 C rocks. Great language.
@KaneryU
@KaneryU 3 ай бұрын
idk why this comment made me so happy you go man! (or girl, lol)
@thobiaslarsen8336
@thobiaslarsen8336 3 ай бұрын
Probably because there is a lot of negativity in the field right now, so its very refreshing to see something actually positive 😂
@youMatterItDoesGetBetter
@youMatterItDoesGetBetter 3 ай бұрын
C is cool.
@gregoryhost5188
@gregoryhost5188 3 ай бұрын
This was really amazing and great timing, I'm currently struggling with algorithms especially trying to figure out where and how exactly to use them.
@techfixer1543
@techfixer1543 3 ай бұрын
Thank you! Your lucid explanations of these algos shows your in depth knowledge, and the accompanying graphs are fantastic and hit a home run in visually expressing the underlying concepts. And you keep the viewer engaged with your peppering of being flawlessly snarky. I had to rewatch the part on the Dijkstra's algorithm to let it sink into my ever evolving brain in "thinking and reasoning" mode. Fantisic vid overall!
@typicallunchbox6934
@typicallunchbox6934 3 ай бұрын
Awesome video, the quality and breakdown was great. Definitely going to be checking out more of your content :)
@surferbum618
@surferbum618 3 ай бұрын
Thank you for making this. Yes please, more of these!
@grassifuentes
@grassifuentes 3 ай бұрын
This is excellent. I took algorithm designs a year ago and this refreshed my memory by a lot and made me want to look into it for practicing again. Thank you!🙏🏽
@hunterlewis5566
@hunterlewis5566 3 ай бұрын
I'm fairly new to computer science and programming and I love this and would love to see more of this, you got my support and vote of confidence!
@alialibaba6672
@alialibaba6672 3 ай бұрын
Hey Forest, great wor and marvelous graphical representation. Please continue
@adnelfigueroa1227
@adnelfigueroa1227 3 ай бұрын
Awesome video! Loved your explanation and the fact that you incorporate funny comments. Exited to see more.
@jynx0riZ0r
@jynx0riZ0r 3 ай бұрын
Best explanation of dynamic programming ever. Thank you. ;-)
@davidrichman2117
@davidrichman2117 3 ай бұрын
Thank you, Forrest Knight! Just review for me, but I wanted to say that you have a wonderful down to earth way of presenting that I really appreciated. Keep up the good work!
@estevanprado2005
@estevanprado2005 3 ай бұрын
Love this vid. nice guide on common and frequently used algorithms, definitely going to sub to your newsletter, thanks!
@ZiaCodes
@ZiaCodes 3 ай бұрын
Hey hey, Your talking style is amazing! The way you explained the algorithms is fabulous! I love it!
@alexrubio9507
@alexrubio9507 3 ай бұрын
Man I wanna say that you're so talented at making these videos. It is so clear that you love doing them. Please keep posting, you re a rockstar!
@techsalesandmore3649
@techsalesandmore3649 3 ай бұрын
never seen your channel before. Totally loving your animations!!!
@max_masterius
@max_masterius 2 ай бұрын
It's so visual! I've got the motivation to look deeper. It's a long time after my university that I actually touched this topic.
@Dwafford01
@Dwafford01 3 ай бұрын
I loved this video, I just want to say I finished my BSc it with programming specialisation in the end of 2020. Now for the first time I'm being treated as a developer by the company I'm working for. It's both exciting and nervous, but with videos like these I think I will be okay.
@slayergaming5421
@slayergaming5421 3 ай бұрын
Great video! I really like the visual depiction of Dijkstra's and A*.
@cedrickmccallon
@cedrickmccallon 2 ай бұрын
Almost 20 years into the game and I wish my CS teachers would have explained these algorithms this well. Great video.
@ctaulelei
@ctaulelei 3 ай бұрын
You're explanation was better than anything I've ever heard! I love how you used Dynamic algorithm to explain the content 😜. First sub I've done in a while for this kind of content. Heading over to look at the rest of your stuff now. Thanks for your time and effort.
@escapist818
@escapist818 3 ай бұрын
Oh man I would love a deep dive video on hashing algorithms, your stuff is great!
@ringringlord
@ringringlord 3 ай бұрын
very straight to the point and zero clutter
@twisthard
@twisthard 3 ай бұрын
Nicely done and presented! A couple of these were not presented in my CS Data Structures and Algorithms course, and as such this was a great view into those. One algorithm I never really got the hang of was hash tables. Now you have me thinking about that again. Well done!
@adye88
@adye88 3 ай бұрын
Thank you for this content. I really enjoyed it. pls keep putting out more!
@alivaliev5152
@alivaliev5152 3 ай бұрын
Right when I needed it most, this gold! Keep on this!
@samiamgrnegsnhamnonftercan2ham
@samiamgrnegsnhamnonftercan2ham 23 күн бұрын
Great vid, would love to see more on algorithms!
@DoNsMaK190
@DoNsMaK190 3 ай бұрын
thanks for all those efforts that made to make those graphic explanation
@baky5372
@baky5372 3 ай бұрын
Whatever video editing software you are using is really cool. i loved watching the code being stepped trhough and then visually seeing what was occuring above it.
@rogueronin1010
@rogueronin1010 3 ай бұрын
Make a new playlist for all algorithms in depth videos. Thanks for the bite size explanation.
@nasirusanigaladima
@nasirusanigaladima 3 ай бұрын
I would love more of this, it's very interesting and informative
@mrskbbs
@mrskbbs 3 ай бұрын
Would love to see more stuff like that! Definitely subbing
@christianmboula8923
@christianmboula8923 29 күн бұрын
Superb content, excellent delivery! where were you when I was taking DS a few decades ago!
@krzysztofs3t532
@krzysztofs3t532 3 ай бұрын
Wow man! I'm a mathematics major, working as a React developer and this video rekindled my pursuit for pure programing, not just learning another library! Thank you very much! Immediately sub!
@francisharrington3155
@francisharrington3155 Ай бұрын
Forrest, your videos are damn near perfect. I've watched 5 in a row and subscribed to your channel and the newsletter. Probably gonna pull the trigger on the notion studious next.
@fknight
@fknight Ай бұрын
I appreciate that! Hearing this really means a lot
@semilife
@semilife 3 ай бұрын
Hey Forrest, first video of yours I have watched. Great presentation style.
@j.p.bikes22
@j.p.bikes22 3 ай бұрын
Really good video, it’s a great summery of what I learned in collage. Will definitely rewatch this sometime in the future 👍
@zakuguriin4521
@zakuguriin4521 3 ай бұрын
I built an array sorting algorithm visualizer with some classmates in programming school for our Javascript Team project. Watching it sort huge arrays was so addicting and mesmerizing.
@markpalma1761
@markpalma1761 3 ай бұрын
showing which part of the code the is being ran live with the animation makes learning this much easier
@vishnum4852
@vishnum4852 3 ай бұрын
Great videos. Liking this nitty gritty concepts which are not popular in yt We need more videos like this man..
@user-ex8hb7hr3h
@user-ex8hb7hr3h 3 ай бұрын
Forest, just discovered your channel. Love your content and style.
@TheDanielvenom
@TheDanielvenom 3 ай бұрын
I always think that I have one kind of sort. This video literally blows my mind. Good vid.
@pingmetal
@pingmetal 2 ай бұрын
Straight to the point! Great video!
@alejandrodiez5511
@alejandrodiez5511 2 ай бұрын
This is really good bro, thank you
@ericajcruz
@ericajcruz 3 ай бұрын
Great video. More "boring" algorithm videos please! Thank you for posting this.
@TampaCEO
@TampaCEO 3 ай бұрын
Outstanding video. I've been a professional developer for over 30 years and I have to say that this video is by far the best I've come across on KZfaq. Here's why: 1. Outstanding graphics. That cannot be understated. 2. Outstanding explanations. 3. You get right to the point (no wasted conversation). Consider me a new subscriber (to add to your half million or so). Congratulations on the success of your channel.
@rnzqt
@rnzqt 3 ай бұрын
Great video, nice summaries. Thanks!
@aaronmorgan4466
@aaronmorgan4466 3 ай бұрын
Really great explanations, thank you. This highlights where I came unstuck in AoC '23 quite well :)
@spikeygoc
@spikeygoc 3 ай бұрын
Loved this video. More please. Passion and well explained 😁
@lalodominguez7121
@lalodominguez7121 3 ай бұрын
Thanksnfor sharing. This is a great help by visualizing the algorithms. Subscribed
@alfonzo6320
@alfonzo6320 3 ай бұрын
Man this is a pretty good video! keep up the good work.👍
@wyohman00
@wyohman00 3 ай бұрын
I wish every creator on KZfaq would watch your videos! To the point with no baloney. Thanks!
@realkorgo
@realkorgo 3 ай бұрын
Nice video! The hashing idea sounds interesting! 😊
@teddyfulk
@teddyfulk 3 ай бұрын
Going to study up on these, thanks!
@cuerpoymentesaludables
@cuerpoymentesaludables Ай бұрын
Great explanation, thank you. Subscribed
@manuelgonzales6483
@manuelgonzales6483 3 ай бұрын
Hope you're doing well. Thanks for sharing your knowledge and understanding of programming 🎉❤
@EagleHunt
@EagleHunt 3 ай бұрын
Make more videos like this. Informative content is what I’m here for
@theodorewyatt3473
@theodorewyatt3473 3 ай бұрын
I definitely like to see more algorithm videos you do them very well and explain things in similar terms. These things should help others as they go along their coding challenges when it comes to algorithms. I would says you should incorporate how code design patterns come into to play too.
@skyname8870
@skyname8870 3 ай бұрын
Bro, you're the best! Thank you so much for your video! No way of me missing the subscribe button!
@incognitiveincognito
@incognitiveincognito 2 ай бұрын
Wish you where my data structures proffesor, then I might not of had to retake the class so many times haha. Amazing video, can't wait to see your other stuff
@dondominic6999
@dondominic6999 3 ай бұрын
Really great video. It would be interesting to see a video on the Knapsack algorithm, and the boarder linear programming and optimization algorithms.
@aimansyahmi6571
@aimansyahmi6571 3 ай бұрын
Please do more of these types of video!!
@ashiqurrahman1385
@ashiqurrahman1385 3 ай бұрын
What a genius content! I love to subscribe to the channel ❤❤
@preludeofme
@preludeofme 3 ай бұрын
Keep these types coming (but also don't stop the long form too 😊)
@Nynxxx
@Nynxxx 3 ай бұрын
I would love for you to do more videos on this stuff as I am about to finish my Comp Sci degree, and I am currently struggling with algorithms. I have not been the best with math in the past, and I just feel like there is something about algorithms I am missing. It just isn't clicking. I understand what they are and what they do, but if I get asked a simple question about solving what time complexity something is, I completely fumble, and just don't even know where to start.
@youMatterItDoesGetBetter
@youMatterItDoesGetBetter 3 ай бұрын
Loveeee that you’re getting that degree. People talk down on degrees nowadays, but they really do get you in the door.
@alexaneals8194
@alexaneals8194 3 ай бұрын
I enjoyed your presentation. I will say that many times insertion sort is used by quick sort once the array is partitioned into small portions like < 10 elements. Also, these are in memory sorts, so if your accessing the disks frequently then you may not want to use these algorithms. Same goes for binary search. I don’t know if you have already covered it, but knowing how to code parsers can be valuable. I have lost count of how many parsers, I have had to code in my professional career.
@BetweenTheBorders
@BetweenTheBorders 3 ай бұрын
I'll be honest, I almost didn't click on this video, bur I thought "you know, as a dangerous amateur, I should see what I should know." And I guess since I've implemented A* before, I'm not too far off the mark. Good to have some sort and search concepts in the toolbox for future research. Well presented!
@alceguy
@alceguy 3 ай бұрын
Amazing. Keep up the good work!
@oussamabenberkane9779
@oussamabenberkane9779 3 ай бұрын
Great vid man! You told me to comment about this so I would like a "hashing algorithms" video please, thankyou 😌
@explorster
@explorster Ай бұрын
Thanks Frank. Great content 👌
@kanemetal
@kanemetal 3 ай бұрын
I don't comment often...this was awesome Forrest! Keep 'em comin'!
@gypsyisking
@gypsyisking 3 ай бұрын
nice video! Would love more in depth and longer videos
@BamboozledOrca
@BamboozledOrca 3 ай бұрын
This was so well done!
@joaquinpickelny8958
@joaquinpickelny8958 Ай бұрын
I really hope you are making money off these videos (this is the first one I've seen), because every single cent would be well deserved. From the content itself to the visual examples and code, not to mention how easily you explain these concepts in a complete yet straightforward way. It took me maybe 13 seconds to subscribe.
@Andron4iKTV
@Andron4iKTV 3 ай бұрын
You made a mistake when show to us time complexity of binary search. You put finger emoji on O(n log n) insead of O (log n).
@fknight
@fknight 3 ай бұрын
Good catch! Thanks for pointing that out.
@TT-hi7lp
@TT-hi7lp 3 ай бұрын
Was just about to comment about this
@alexrubio9507
@alexrubio9507 3 ай бұрын
​@@TT-hi7lphahaha same here
@OGMann
@OGMann 3 ай бұрын
Oh yep. Everyone was.
@whophukenfarted
@whophukenfarted 2 ай бұрын
Amazing video! I can’t wait until I can develop this type of understanding of the different algorithms! Thank you for sharing this! 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥👏👏👏👏
@iceboxLP
@iceboxLP 3 ай бұрын
really nice video and a very good presentation. please consider making more videos as such
@crystalg2671
@crystalg2671 3 ай бұрын
Ah, this was so good! Thank you!!
@enoz.j3506
@enoz.j3506 3 ай бұрын
Subbed, great explanations, Thank you.
@SN-ed7wi
@SN-ed7wi 2 ай бұрын
Excellent vid for all the reasons stated by others, well done. Too bad there are some who think the info is not practical today. The fundamentals you learn by coding even one of the efficient sorting algorithms will stay with you forever.
@CauseItsNotMidnight
@CauseItsNotMidnight Ай бұрын
More of this. Visual representation is stimulating, explanation is clear, analogies could be slightly more engaging, but are effective as is.
@fredrikzels2637
@fredrikzels2637 3 ай бұрын
Really interesting!! More of this.
@forsmanos
@forsmanos 2 ай бұрын
Very nice graphics for your examples. Nice enough, i almost felt like i was watching an ad.
@porkchopsuitcase9906
@porkchopsuitcase9906 20 күн бұрын
Legit just learned about searching and sorting yesterday in comp sci 2 in java good video 👍
So, you want to be a programmer?
20:43
ForrestKnight
Рет қаралды 62 М.
НЕОБЫЧНЫЙ ЛЕДЕНЕЦ
00:49
Sveta Sollar
Рет қаралды 7 МЛН
Она Постояла За Себя! ❤️
00:25
Глеб Рандалайнен
Рет қаралды 6 МЛН
How to Start a Coding Project: A Guide for Beginners
15:47
4 Data Structures You Need to Know
9:42
ForrestKnight
Рет қаралды 262 М.
The hidden beauty of the A* algorithm
19:22
polylog
Рет қаралды 813 М.
Do NOT do this when learning to code
6:44
The Tech Dad
Рет қаралды 7 М.
10 weird algorithms
9:06
Fireship
Рет қаралды 1 МЛН
How Data Structures & Algorithms are Actually Used
11:39
ForrestKnight
Рет қаралды 132 М.
How Senior Programmers ACTUALLY Write Code
13:37
Healthy Software Developer
Рет қаралды 1,3 МЛН
How Software Engineers Can Write Better Code
20:47
ForrestKnight
Рет қаралды 30 М.
Never install locally
5:45
Coderized
Рет қаралды 1,6 МЛН
НЕОБЫЧНЫЙ ЛЕДЕНЕЦ
00:49
Sveta Sollar
Рет қаралды 7 МЛН