Big-O Notation in 100 Seconds

Поділитися
Вставка
  • Опубліковано 17 гру 2019
  • Learn Big-O Notation in 100 Seconds (of Computer Science). ⚡🔬
    #compsci #100SecondsOfCode
    Install the quiz app 🤓
    iOS itunes.apple.com/us/app/fires...
    Android play.google.com/store/apps/de...
    Upgrade to Fireship PRO at fireship.io/pro
    Use code lORhwXd2 for 25% off your first payment.
    My VS Code Theme
    - Atom One Dark
    - vscode-icons
    - Fira Code Font
  • Наука та технологія

КОМЕНТАРІ • 307

  • @TheUntitledworks
    @TheUntitledworks 4 роки тому +1687

    The kid crying is exactly how I feel when someone asks me about time and space complexity 😢

    • @Fireship
      @Fireship  4 роки тому +158

      same

    • @vladpascari
      @vladpascari 4 роки тому +35

      Keep this 100s project, it's amazing! 👏

    • @yogenp
      @yogenp 4 роки тому +18

      That's how i feel if someone asks me if my code is efficient.

    • @codeaperture
      @codeaperture 2 роки тому +5

      @@Fireship haha.. the best way to respond to a junior dev is senior saying he doesn't understand either

    • @efrainpineda664
      @efrainpineda664 2 роки тому +2

      Same here

  • @Shizool
    @Shizool 4 роки тому +1827

    It's year 2030, computer science universities go bankrupt because everyone is learning from fireships 100s videos instead of lectures. Keep it up ! 😁

    • @ACodingWoof
      @ACodingWoof 3 роки тому +20

      Yeye. I basically learnt basic js without a course. All I did was watch fireship vids.

    • @vaisakhkm783
      @vaisakhkm783 2 роки тому +2

      @@ACodingWoof wow that's amazing...

    • @ACodingWoof
      @ACodingWoof 2 роки тому +3

      @@vaisakhkm783 yup ikr

    • @justwaterweight
      @justwaterweight 2 роки тому +2

      Watching One hour fireship video >> Learning one semester

    • @orvvro
      @orvvro 2 роки тому +2

      @@justwaterweight ==

  • @piotrszewczyk9749
    @piotrszewczyk9749 4 роки тому +493

    Dude! your materials are like O(1/n)... The more advanced concepts you take, the shorter and easier to comprehend your material is :) keep it up! you're doing a great job

    • @arhamaneeq3685
      @arhamaneeq3685 4 роки тому +8

      I'm just asking here, but if you were to have code with the complexity of O(1/n), would that mean the program works less efficiently with fewer inputs than with greater?
      Also, I doubt it's pragmatic, but is it possible to have an algorithm with the complexity of O(1/n)

    • @MsSuyash1995
      @MsSuyash1995 4 роки тому +12

      @@arhamaneeq3685 I think that O(1/n) is not possible since the number of computations grows as the size grows..
      We might use memoization to store some recurring intermediate results in cache but even then, there is still slight addition to the computational time...
      Also, O(1) is the fastest time any possible computational operation can take... Having an algorithm that has a Big O of 1/n would mean that it's faster than O(1) which is an impossible task to achieve...

    • @javabeanz8549
      @javabeanz8549 4 роки тому +3

      @@MsSuyash1995 maybe when quantum computing has general availability ;0)

    • @mthf5839
      @mthf5839 3 роки тому +1

      @@MsSuyash1995 this seems kinda like O(1/n) to me:
      the problem: your inputs are an array, you are supposed to return an element from that array with index greater than 500.
      the algorithm to do it:
      pick a random element from the array. Check if it is at index 500 or greater. If it is, return in, otherwise, try again.
      Is this O(1/n) on average? Or given what you said about being faster than O(1), maybe it's O(1 + 1/n)?

    • @ehwu393
      @ehwu393 2 роки тому +1

      @@mthf5839 No. Random number generation and array lookup based on index are both O(1) time complexity. Also this algorithm will loop forever for arrays shorter than 500, so there is no average time complexity. Getting the index of an array element based on its value is on average O(n) time. Also I don't get why you would bother getting an item from an array, when you could just check if the number is above 500 right after you generated it.

  • @sharukh7860
    @sharukh7860 4 роки тому +486

    I'm so pissed off at this because it ends at 100 sec.

    • @muhammadfaateh6463
      @muhammadfaateh6463 4 роки тому

      same here

    • @mohanbarman5982
      @mohanbarman5982 4 роки тому +8

      99 sec.

    • @alessandrobelottidev
      @alessandrobelottidev 4 роки тому

      @@mohanbarman5982 right

    • @davidgkirk
      @davidgkirk 3 роки тому +18

      It is 100 seconds because it has O(n^2) with n=10 and a one second delay in the inner for loop since the bubble sort is executing on a Commodore 64.

  • @AlienAndrew51
    @AlienAndrew51 4 роки тому +246

    It took me forever to understand this, even when I was taking data structures in college. I really like the way you explain this as it's very similar to CS50, the free course that Harvard provides, but you do it in 100 seconds.

    • @Fireship
      @Fireship  4 роки тому +32

      Nice! I'll have to check that out

  • @yocheeseify
    @yocheeseify 4 роки тому +151

    Can you explain my life in 100 seconds too? You're amazing man 🔥

    • @hugodsa89
      @hugodsa89 4 роки тому +14

      He'd probably sum it up in less than 100 seconds, just saying lol

  • @carltongordon
    @carltongordon 4 роки тому +56

    this taught me more than the weeks I spent watching tutorials on this

  • @mapengbo0314
    @mapengbo0314 4 роки тому +34

    I will watch every single video this GOAT is making

  • @lord12790
    @lord12790 4 роки тому +36

    From Application Development to Software Engineering to now Computer Science... Looks good for audience of this channel. Keep up the good work. Much needed video for people who are not from computer science and well explained from perspective of Computer Science and Engineering Graduate.

  • @ancna0156
    @ancna0156 Рік тому +9

    You explained this better in 100 seconds than my professors did in college over 5 months.

  • @stachowi
    @stachowi 4 роки тому +66

    I'm jealous of any current CS students who have these videos... YOU HAVE NO IDEA HOW LUCKY YOU ARE!

  • @kentutterback6485
    @kentutterback6485 4 роки тому +39

    After sharing the first #100secondsofcode video I made a comment wishing for this to be a series. I'm very happy to see it as a reality. Thank you

  • @GabrielLima-og5qd
    @GabrielLima-og5qd 4 роки тому +6

    I'm really glad that we have people like you here in UA-cam, awesome videos with amazing quality and great knowledge.
    Have you ever considered making videos about Programming Paradigms? Design Patterns?

  • @RagePeanut
    @RagePeanut 4 роки тому +2

    I remember having trouble understanding how the Big-O notation worked years ago. This video will be so useful for students around the world, thank you !

  • @GameMuse
    @GameMuse 4 роки тому +3

    Thank you. Had a whiteboard interview with logic questions and my UA-cam feed has been all about them, this is the first video to tell me what the maths was people kept using to show their thinking!! Big O notation, ahhhhh the relief and all in 100 seconds! You god

  • @kissu_io
    @kissu_io 4 роки тому +6

    Wow, by far the best explanation that I've ever seen (thanks to the graphs). 👌🏻

  • @misterkenwong
    @misterkenwong 2 роки тому +2

    I absolutely love the art style and of cos the way you presented!
    Can you please please please make the 100 seconds series along with like x mins series for more in dept details?

  • @khamalipowell
    @khamalipowell 4 роки тому +3

    I'm loving this concept of code in 100 seconds. Keep going please

  • @robbierob6917
    @robbierob6917 Рік тому

    Your Videos have the Best Visualizations! Thank You Fireship!

  • @invisibleimpostor299
    @invisibleimpostor299 4 роки тому +1

    Seriously though, these 100 seconds are probably the most useful 100 seconds until now and for what I will be needing it.

  • @davngo
    @davngo 4 роки тому

    Extremely great fun for this. Short, sweet and to the point with great visuals.

  • @just_jimmy
    @just_jimmy 4 роки тому +3

    Do more of these videos! I think the format is awesome!
    Maybe even a bit more than 100s wouldn't hurt. I presume it would a bit easier for you also to fit everything in.

  • @pj1986
    @pj1986 4 роки тому

    Love the format, amazing as always.

  • @Aziqfajar
    @Aziqfajar 4 роки тому +2

    These 100s' videos making me motivated to do one for study purposes. Really like it!

  • @ampersignia
    @ampersignia 3 місяці тому

    Was confused by a course I'm taking, and am relieved after seeing this. They really overcomplicated it, and you nailed it.

  • @tythedev9582
    @tythedev9582 4 роки тому

    I love this. Your succinct explanations cleared up this topic for me. Thank you very much, liked and saved!

  • @lukewright5544
    @lukewright5544 2 роки тому

    you have the gift to explain something allegedly complex in a simple manner. i salute you.

  • @Shmack_
    @Shmack_ 4 роки тому

    Love these videos keep them coming!

  • @shapelessed
    @shapelessed 2 роки тому +5

    One thing about big O is that in some cases you'd actually want to use the less optimal algorithm. Crazy optimised search algorithms for example will introduce a lot of overhead before actually performing the search and this only scales well with big numbers where searching over an array that we know is gonna be just a few items long would be better off with a normal for loop.

  • @jrhaven
    @jrhaven 2 місяці тому

    This is way more helpful than my CS prof's lecture, thank you!

  • @CerFrus
    @CerFrus 2 роки тому

    best 100 productive seconds I've ever seen, thanks man!

  • @erez7020
    @erez7020 4 роки тому +2

    Amazing production value, thanks buddy.

  • @Marcosmapf
    @Marcosmapf 4 роки тому

    This is really good content, i'm surprised you summarised it in such short ammount of time. Great work and keep going!

  • @hierophantpurple8020
    @hierophantpurple8020 Рік тому

    These short form videos really help me learn better than long lessons with power point slides, especially with my adhd.

  • @worldgamer8550
    @worldgamer8550 4 місяці тому

    Very well explained, thank you!

  • @barbieroalex
    @barbieroalex 4 роки тому

    please please keep doing this great work, just amazing! thk u

  • @trophieboi1820
    @trophieboi1820 4 роки тому

    loving this short daily clips..................waitin for more.

  • @bhagawatikishore2336
    @bhagawatikishore2336 2 роки тому

    I have taken up this mission to watch all your videos and like it

  • @Gentarozzo
    @Gentarozzo 4 роки тому

    This is so cool and visual... thanks mate!

  • @kostiabazrov-life
    @kostiabazrov-life 3 роки тому +1

    AMAZING LESSONS !!! DREAM LESSONS!

  • @MightyCoffeeMaker
    @MightyCoffeeMaker 4 місяці тому

    The best video on the subject.

  • @David-jn1gg
    @David-jn1gg 2 роки тому

    Thank you ,all the other online definitions made it so hard for me. But I finally understand what BigO notation means

  • @user-dl5cl6li9p
    @user-dl5cl6li9p 3 місяці тому

    not even kidding i watched this video about 30 seconds before i started my test that covered this, thank you for the short form!

  • @zainroyan1556
    @zainroyan1556 9 місяців тому

    Bro istg this dude explain things better and easier to understand

  • @ramonmaximiliano3557
    @ramonmaximiliano3557 2 роки тому

    This was amazing really, you made it very simple to understand in a short time, thank you

  • @pladselsker8340
    @pladselsker8340 4 роки тому

    yo thank you so much! That's literally the kind of teaching I'm looking for on youtube. This video was super efficient and taughtfull, you saved me some damn time man, I love you xD I feel so satisfied right now

  • @how-to2346
    @how-to2346 2 роки тому

    I think I FINALLY understood it!

  • @divinedela9125
    @divinedela9125 4 роки тому

    This is so cool. Perfect for reference

  • @BassheadMusicConnoisseur
    @BassheadMusicConnoisseur 4 роки тому

    Just when i needed it, ty

  • @mujeexminiminer7653
    @mujeexminiminer7653 4 роки тому

    This is amazing as always!! Please share the tools you use for making such amazing videos. Thank you for all your hardwork❤

  • @qazyhn94
    @qazyhn94 4 роки тому

    Just amazing, please continue

  • @hojdog
    @hojdog 4 роки тому

    Didn't knO this was gonna be a series, great idea!!

  • @haiderimam8977
    @haiderimam8977 2 роки тому

    Thank you mate thank you so much❤️

  • @naveedalirehmani4135
    @naveedalirehmani4135 2 роки тому

    This video is amazing explained so much in such a short period of time.

  • @psybitcoin
    @psybitcoin 4 роки тому

    Really good video. Simple. Fast. Knowledge.

  • @c-cg
    @c-cg 4 роки тому

    These videos are too good, keep it up!

  • @edgarr_com
    @edgarr_com 3 роки тому +1

    Thanks for this! It would be nice to see a video on how to calculate the big O notation of functions. 🤜

  • @tkp2843
    @tkp2843 4 роки тому +1

    WE WANT MOREEEEE! GREAT VID!

  • @user-jw8sx1pw6w
    @user-jw8sx1pw6w Рік тому

    OMG after all this years I finally understand it%)

  • @samuelkahunga5987
    @samuelkahunga5987 4 роки тому

    very high quaility video, as always. God bless

  • @nebraska7891
    @nebraska7891 4 роки тому

    Thank you Jeff!

  • @grosssocks3699
    @grosssocks3699 8 місяців тому +1

    its so weird how i tried to learn this big o concept from various sources like udemy, youtube, coursera, etc since past few years but only being able to fully understand today at around 3:15 AM. Thanks a lot Fireship for helping an about to graduate cs student

  • @aiman1562
    @aiman1562 4 роки тому

    I love it btw!! We want more 100s

  • @FangerZero
    @FangerZero 2 роки тому

    Thanks, for explaining what it actually is. Everyone else dives into explaining the different kinds of Big-O Notations.

  • @azr_sd
    @azr_sd 4 роки тому

    Dammnnn it's simple and to the point..cheers and happy new year 😊

  • @viniciusgoncalves8208
    @viniciusgoncalves8208 2 роки тому

    Simply amazing

  • @CariagaXIII
    @CariagaXIII 4 роки тому

    finally someone explained this perfecctly

  • @kriztoperurmeneta7089
    @kriztoperurmeneta7089 4 роки тому

    This format is good!

  • @dishanmadhuranga8032
    @dishanmadhuranga8032 2 роки тому

    Your content is easy to understand..pls continue good work..

  • @CesarICAO
    @CesarICAO 4 роки тому

    You reminded me of my algorithm analysis and design classes in the university 📚😁
    Ty for all 😁

  • @MANTLECURVE
    @MANTLECURVE 4 роки тому

    Thanks for these 100s videos :)

  • @hl7297
    @hl7297 4 роки тому

    I'm more impressed by the effort you put in making the thumbnails

  • @omarz5009
    @omarz5009 4 роки тому

    Best 100 sec of my time.

  • @yashsharma3857
    @yashsharma3857 4 роки тому

    Wow that's great explanation in just 100 seconds . We need more videos like these . 😅

  • @odrazleinad
    @odrazleinad 3 роки тому

    Just excellent!

  • @dinkopehar982
    @dinkopehar982 4 роки тому

    This is amazing explanation is such short time 😮

  • @GaetanoBarreca
    @GaetanoBarreca Рік тому

    Thanks!

  • @sazk4000
    @sazk4000 2 роки тому

    thank you for this

  • @bitp
    @bitp 4 роки тому +2

    Really helpful, I always read about log(n) performance and had kind of the right idea about it in my head but wasn't sure if it was correct. Never bordered to check it online, so thanks for this awesome video :)

    • @lord12790
      @lord12790 4 роки тому

      O(log n) one of the most efficient algorithms have it like quick sort. Others like merge sort or heap or tim sort (tim sort is used in javascript v8 engine used in node and chrome) have O(n log n)

    • @Hauketal
      @Hauketal 2 роки тому

      @@lord12790 Sorry, quicksort is O(n log n) too in the average case, even O(n²) in the worst case. It is just preferred over the others because those have larger coefficients hidden in the O.

  • @flamingninjas7856
    @flamingninjas7856 5 місяців тому

    GREAT VIDEO.

  • @charan_75
    @charan_75 3 роки тому

    Your editing skills are impressive.

  • @sachethana
    @sachethana 2 роки тому

    Bro, for some reason, it's today that I understood what big O notates. (8 years as a software eng. Lol) thanks

  • @kimaegaii
    @kimaegaii Рік тому

    yes thank you!

  • @shashidhar71
    @shashidhar71 3 роки тому

    To the point 🙏🏼

  • @Qors1314
    @Qors1314 4 роки тому

    Great content!

  • @transmissions1135
    @transmissions1135 4 роки тому

    YES! Another one!!

  • @sumitsawant
    @sumitsawant 2 роки тому

    I want more!

  • @CodingCatDev
    @CodingCatDev 4 роки тому +4

    Are you serious this is the simplest and most succinct explanation EVER!

  • @lin4409
    @lin4409 7 місяців тому

    Hands down the best explanation 🫡

  • @bamnjphoto
    @bamnjphoto 4 роки тому +5

    I remember doing a technical interview a few years ago and being asked about Big O and I was dumbfounded. I then studied up on it afterwards. This was the best explanation I have seen condensed into 100 seconds

    • @winkbrace
      @winkbrace 2 роки тому +1

      And have you ever had to use Big O in you daily job? Ever?

    • @bamnjphoto
      @bamnjphoto 2 роки тому +1

      @@winkbrace no not ever in 20+ years of programming, it just a tech interview question to weed out candidates

  • @jenson274
    @jenson274 4 роки тому

    So far one of my favorite js programming channel

    • @rubenheymans1988
      @rubenheymans1988 4 роки тому

      can you recommend others? I can't find more programming channels that cover angular/firebase , go fast enough and are not Indians (just don't like the hard to understand accents, I'm not native English) ...

    • @jenson274
      @jenson274 4 роки тому

      Coding train, thenewboston cant think from the top of my head but this 2 r pretty good

  • @StayAware9
    @StayAware9 2 роки тому

    Very important video

  • @nonamenolastname59
    @nonamenolastname59 4 роки тому

    Please make an in depth series about algorithms and data structures

  • @toxoreed4313
    @toxoreed4313 9 місяців тому

    better than most of videos

  • @masood2
    @masood2 4 роки тому

    Do more like this.

  • @rizanmohomed8029
    @rizanmohomed8029 4 роки тому +1

    100s segments are excellent

  • @gabrielaudette7345
    @gabrielaudette7345 4 роки тому +2

    You omitted the factorial O(n!)

  • @DragonStoneCreations
    @DragonStoneCreations 2 роки тому

    This 100 seconds was taught to us in college for several hours, yet we didn't had this level of clarity

  • @aleksd286
    @aleksd286 4 роки тому

    Thanks