Big-O Notation - For Coding Interviews

406,717
0
2022-10-10に共有
🚀 neetcode.io/ - Get lifetime access to all current & future courses I create!

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

Checkout my second Channel: @NeetCodeIO

🥷 Discord: discord.gg/ddjKRXPqtk
🐦 Twitter: twitter.com/neetcode1

🐮 Support the channel: www.patreon.com/NEETcode

Code from the video: neetcode.io/courses/lessons/big-o-notation

⭐ BLIND-75 PLAYLIST:    • Two Sum - Leetcode 1 - HashMap - Python  
💡 DYNAMIC PROGRAMMING PLAYLIST:    • House Robber -  Leetcode 198 - Python...  

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

コメント (21)
  • @zeeg1529
    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. HUUUUUGE thank you for this. It's almost unbelievable the content of this quality is out here on youtube for free!
  • @jayjay4027
    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
  • @daen3206
    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
  • 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!
  • @Caggen218
    Been having some issues wrapping my head around parts of big-O, and this was precisely the explanation I needed for the last bits to snap into place! Cheers!
  • Thanks for being active on YT for the ones wo can't afford your course 🙂
  • 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!
  • @yizhou2675
    Love the way you explain things, so clear and creative and EASY to understand!!
  • @markganus1085
    simple and to the point. worth checking over and over
  • @jspanchal
    Possibly the simplest way of explaining Big-O notations. Kudos.
  • This is the best explanatory video I've seen about Big-O notation. You make it friendly to understand. Thank you very much!
  • @joker345172
    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!
  • This is the best explanation on YouTube about the topic, congrats
  • First video I've ever watched from this channel. Subscribed. Extremely well explained.
  • @amospan14
    Really, really appreciate you explaining this topic in detail! This was amazing!
  • Man! This is the best big-O explanation video on the internet 🙏🏻 thanks so much for your effort! 👏🏼👏🏼
  • 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.