Big-O Notation - For Coding Interviews

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

Going over all of the common big O time and space complexities, with a focus on coding interviews.

Checkout my second Channel: @NeetCodeIO

0:00 - Intro
0:43 - What is Big-O
1:48 - O(1)
2:55 - O(n)
6:35 - O(n^2)
9:30 - O(n * m)
10:02 - O(n^3)
10:45 - O(logn)
13:18 - O(nlogn)
14:58 - O(2^n)
17:30 - O(sqrt(n))
18:26 - O(n!)
19:26 - Conclusion

#coding #neetcode #python
Рекомендации по теме
Комментарии
Автор

60% through the video but just can't hold in the comment any longer. this is by far the best big-O notation explanation I've ever encountered in my life. I have bachelor in computer science and master in AI systems, and have solved a bit more than 300 leetcode problems, aside from almost 8 years of software engineer production experience, yet nobody was able to explain this better to me than you did. an absolutely amazing visualisation!
before this video I knew the most of basic notations (O(n), O(n^2) etc), yet I was still struggling with logarythmic ones. thank you for this. It's almost unbelievable the content of this quality is out here on youtube for free!

zeeg
Автор

For people who still get confused, imagine you have an array with length of 8, after 1 step, the size is 4, step 2 size is 2, step 3 size is 1. So 2^3= 8, another way of saying is, it takes 3 steps to get to 1. So 2^3=8 means log2(8)=3. Which means if you have an array of n elements, then 2^x =n, where x is the steps to take, so log2(n) = x

jayjay
Автор

next video suggestion:
1. time complexities of graph traversals BFS/DFS in terms of V & E
2. time complexities of advanced graph algo like djikstra, bellman ford, prim, kruskal MST, topo sort
3. time complexities of backtracking algos in the backtracking section

daen
Автор

I've been struggling with this A LOT, so you couldn't have chosen a better time to make this video. Thank you for single-handedly getting us all through the grind!

frosty_teacup
Автор

20:04 I think it's important to note that big O notation does not measure the efficiency of an algorithm, it only measures the CHANGE in performance as the data set increases in size. The invisible constants in big O are VERY important when working on actual real world applications. Oftentimes increased performance comes from reducing the cost of performing individual iterations, which doesn't change the big O at all.

NihongoWakannai
Автор

The level of quality in this video is off the charts!

I have a bachelors in computer science and got my masters from a Tier 1 university, and although I've passed my classes in algorithm complexity, NONE of my professors had the tact and the ability to present this subject like you did in this video. Absolutely phenomenal job, with this video you're democratizing access to information and teaching this crucial subject to so many different people. Absolutely stellar job!

joker
Автор

I've seen a ton of algorithm lectures and your videoes are the only ones that have finally gotten through to me thank you for making them!

terrypark
Автор

Man, you are a genius. I love the way you explain your stuff. Much love!!!

agbeliemmanuel
Автор

Possibly the simplest way of explaining Big-O notations. Kudos.

jspanchal
Автор

Time stamps in description very helpful - thanks!


1:48 - O(1)
2:55 - O(n)
6:35 - O(n^2)
9:30 - O(n * m)
10:02 - O(n^3)
10:45 - O(logn)
13:18 - O(nlogn)
14:58 - O(2^n)
17:30 - O(sqrt(n))
18:26 - O(n!)
19:26 - Conclusion

iggykarpov
Автор

Thanks for being active on YT for the ones wo can't afford your course 🙂

indianengineer
Автор

Bruh how do you explain things so well? Like seriously...not everyone who knows dsa has the potential to lay things out so easily. Your explanation has helped me a lot in many problems. Thanks a bunch man. Thanks a bunch.

nischayagrawalVlogs
Автор

The "for coding interviews" was what lead me to click on this one over the other 10 "Big-O Notation" videos I had recommended to me

dan
Автор

9:08 your simple, intuitive explanation on the proof of recursive loop is amazing. I took combinatorics classes in college where it took a professor 40 minutes to convey the similar intuition. To everyone out there feeling Fomo on college-- don't.

Jonathan-rmkt
Автор

studying this as a devops engineer who has never had to do anything related to this in my job, but has an interview with Amazon. Thanks Amazon!

bloodtalon
Автор

im not going to lie neetcode this is the hardest thing i ever had to learn in my life, but I will continue trying to get better at this algorithms stuff. thank you for putting out content to continue to help me out.

moestaxx
Автор

well explained my fried, you summarised two weeks worth of lectures in 20 minutes thanks for this

shawngeorge
Автор

This is a brilliant - I am definitely showing this to my students to help them understand Big O notation.

samanthapennington
Автор

I can now definitely say that this video is one of the best if not the best comprehensive video on YouTube that explains Big O Notation ! Thanks so much bro

myko-ewcw
Автор

holy shit that is the single best explanation for log n I have ever seen, thank you SO much

leokeatonn