Big O notation - Data Structures & Algorithms Tutorial #2 | Measuring time complexity

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ย. 2024

ความคิดเห็น • 456

  • @codebasics
    @codebasics  2 ปีที่แล้ว +14

    Do you want to learn python from me with a lot of interactive quizzes, and exercises? Here is my project-based python learning course: codebasics.io/courses/python-for-beginner-and-intermediate-learners

    • @rakoon6198
      @rakoon6198 2 ปีที่แล้ว

      Hyy can i be a software engineer by coding in python, and learning frontend languages like html, css, javascript.

    • @lmt2612
      @lmt2612 2 ปีที่แล้ว +1

      I watch your videos because they're easy and resourceful but this video is too fast.please make another video on time complexity and please make it very beginer friendly

  • @mohitkumargautam4060
    @mohitkumargautam4060 4 ปีที่แล้ว +445

    there is no other teacher who teaches Data science and Data structure simultaneously . (Great sir once again thank you from bottom of my heart)

    • @codebasics
      @codebasics  4 ปีที่แล้ว +31

      Glad you liked it Mohit.

    • @flamboyantperson5936
      @flamboyantperson5936 4 ปีที่แล้ว +5

      Your appreciation is our inspiration

    • @mdshareefpc8469
      @mdshareefpc8469 4 ปีที่แล้ว +6

      @@codebasics plz make more videos on data structure and algo

    • @mdshareefpc8469
      @mdshareefpc8469 4 ปีที่แล้ว +3

      @@codebasics and also post daily one coding interview solved questions

  • @dewanmasumanazneen8366
    @dewanmasumanazneen8366 2 ปีที่แล้ว +139

    learnt so much more in a 12 min video than my 6 months semester at university...Thank you sir.

  • @Niko-zl5hn
    @Niko-zl5hn 4 ปีที่แล้ว +78

    very nicely explained, one major problem youtube tutorials have is they have this assumption that we already know the basic things so they skip over those parts, even the really important ones, but you explained it right from the base and still managed to keep it short, thank you

  • @vikasmanav3715
    @vikasmanav3715 4 ปีที่แล้ว +50

    Not all heros wear capes.. You're one of them... May the force be with you....

    • @codebasics
      @codebasics  4 ปีที่แล้ว +18

      Thanks Vikas for the comment. I am just trying to build the society where people help each other. Spread the knowledge, be the real and life is all set. 😀

    • @vikasmanav3715
      @vikasmanav3715 4 ปีที่แล้ว

      @@codebasics Kudos🙏🙏

  • @akmzahidulislam2764
    @akmzahidulislam2764 2 ปีที่แล้ว +8

    I don’t know how these explanations could be done better. Just amazingly beautiful, boss. You have written and recited poetry of coding.

    • @codebasics
      @codebasics  2 ปีที่แล้ว +1

      I am happy this was helpful to you.

  • @talkingexpi
    @talkingexpi 3 หลายเดือนก่อน +1

    i just got an eye opener video on Big O notations, I tried learning from many sources but the clarity here is just amazing.

  • @minhazulislam4682
    @minhazulislam4682 4 ปีที่แล้ว +18

    You are doing great. I look up to you. You try to make us feel what is under the hood, in an intuitive manner. I wish there was more teachers like you.

  • @bensoudayouness8688
    @bensoudayouness8688 ปีที่แล้ว +40

    Please, could you add captions for deaf people 😊 it's a simple button 😉

    • @ThanishAlva
      @ThanishAlva 3 หลายเดือนก่อน +1

      All the best my brother 🤍

  • @ritammondal3820
    @ritammondal3820 3 ปีที่แล้ว

    Maine 20 se 30 video dekha hay time complexity ke upar par itna simply or example ke sath koy nehi samjhaya.....❤️❤️

  • @generallifing
    @generallifing 2 ปีที่แล้ว +5

    StatQuest, 3brown1Blue, and this channel become my survival kits as a software engineer

  • @অর্ণবচ্যাটার্জী-ধ১খ

    i am teaching coding to myself, and soon realise that without knowledge of algo and datastructure its DOA...read many books, understood the basics...but this video is byfar the BEST explanation i have come across...only possible if the tutor understands it well rather than copying from any text book..thank you

  • @gappogappo
    @gappogappo 2 ปีที่แล้ว +34

    9:46 It took me a while to wrap my head around how exactly he derived the order to be O(log n).
    Consider the example he provided: an array of eight digits with the 7th digit being our target value. Using binary search, this example is actually a worst case scenario. Why? Well because we had to go all the way to the 3rd iteration, where we are at an array size of n/(2^3). Basically, since n=8 in this example, we have 8/(2^3) = 8/8 = 1. So we see that the worst case scenario is when n/(2^k) = 1.
    Each iteration is cutting the array size in half. The worst case scenario is where we keep having to cut the array size down until it goes from being length n (originally) all the way to 1.

  • @vijitpugalia6041
    @vijitpugalia6041 3 ปีที่แล้ว +1

    Fantastic job! No intro no waste of time just some Quality Content, Great Work!

    • @codebasics
      @codebasics  3 ปีที่แล้ว +1

      Glad you liked it!

  • @Orgwell
    @Orgwell 2 ปีที่แล้ว +2

    I appreciate the detail and simplicity you bring to this lesson. You are great teacher, Sir. Many thanks.

  • @braveheartcreations3493
    @braveheartcreations3493 3 ปีที่แล้ว +21

    I just learn this on my 27th age! What is log what is log2.. haha.. I was sleeping on my maths classes :D What is the main comedy in this?? I have a post-graduation in computer science !!!! :D :D :D

  • @madunishant6052
    @madunishant6052 4 ปีที่แล้ว +7

    I have to admit it whatever you teach it sound's very easy. Be it right from the git basics, Data Science and now DS & Algos. Such a wonderful teacher you are. I normally don't comment unless i really like the content but the way you teach and the content you put is on point, crisp and very understandable for a complete novice like me. Thank you so much again. I wish to see this channel hit more than 500K soon. More power to you :)

    • @codebasics
      @codebasics  4 ปีที่แล้ว +2

      Thanks madu, glad to see your comment and kind words of appreciation first thing in a day. 😊👍

  • @satyaprakashpandey6911
    @satyaprakashpandey6911 4 ปีที่แล้ว +9

    I am eagerly waiting for data structure with python and fortunately I found this. It is heartiest request to complete this playlist..I will be very thankful.

    • @codebasics
      @codebasics  4 ปีที่แล้ว +5

      Dear Satyaprakash, I am trying to cover almost all the topics. Don’t worry, you will get the enough content through codebasics. 😀

    • @satyaprakashpandey6911
      @satyaprakashpandey6911 4 ปีที่แล้ว

      @@codebasics thank you sir

  • @prakharmishra2977
    @prakharmishra2977 4 ปีที่แล้ว +9

    I am so fortunate to be a learner of this channel,i extol the way you explain the complex things in such a intuitive way.You are really patrician, so generous and erudite Mentor i ever seen.Keeping uploading such stuff sir regarding Data Structure and algorithm.

  • @avnishkatiyar296
    @avnishkatiyar296 3 ปีที่แล้ว +5

    Thank you for explaining this complex topic in just 12 mins. You are really a Master !!!

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      Glad it was helpful!

  • @kzr_567
    @kzr_567 4 ปีที่แล้ว +59

    Your explanations are so simple and interesting, thanks for this !

    • @codebasics
      @codebasics  4 ปีที่แล้ว +4

      Glad you like them!

    • @ajmalbangash6928
      @ajmalbangash6928 4 ปีที่แล้ว

      But for a higher classes

    • @hurgama7093
      @hurgama7093 3 ปีที่แล้ว

      @@ajmalbangash6928 i am at 5

  • @blockchainstreet
    @blockchainstreet 4 หลายเดือนก่อน

    Very clear explanations!.. I missed giving full attention to math class during my engineering!!!..
    Thank yo so much Guru ji!!

  • @TusharOnTheMove
    @TusharOnTheMove 3 ปีที่แล้ว

    Before seeing this video, my confidence is none.. but after seeing this, i have a liitle bit of confidence!! Great teaching sir

  • @_Ayush_Tiwari_08
    @_Ayush_Tiwari_08 3 ปีที่แล้ว +1

    after watching a lot of videos related to DS ,I got this and now I can say that this is the best till now.....thank you

  • @vijaygehani2123
    @vijaygehani2123 3 ปีที่แล้ว +1

    Love the way you explained the time complexity with the ease. Highly Appreciate it, thank you Sir!

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      I am happy this was helpful to you.

    • @vijaygehani2123
      @vijaygehani2123 3 ปีที่แล้ว

      @@codebasics Trust me Sir, I was not expecting a comment back since the video was 1 year old. This shows your dedication for your students cum subscribers. 🙏

  • @apoorvshrivastava3544
    @apoorvshrivastava3544 4 ปีที่แล้ว +1

    woww sir auper awaited series gotta be a biggest hit abi tak data science ko rakh kar k kisi ne ds and algo nai banaya h you tube p

    • @codebasics
      @codebasics  4 ปีที่แล้ว +1

      Yes Apoorv, that’s why I decided to start DS. Knowledge of DS is indeed very essential.

  • @PiladelakYindeesap
    @PiladelakYindeesap ปีที่แล้ว

    Thank you so much for your explanation. I was struggling a lot for this big O notation in my uni class. your explanation is really clear and give me a fully understanding.

  • @mansijain7196
    @mansijain7196 3 ปีที่แล้ว +18

    Hey! Your explanation was great! But can you provide more examples of how to calculate the time complexities and the increasing order of time complexities?

  • @ojasaklecha
    @ojasaklecha 3 ปีที่แล้ว

    I am literally having a Bruh moment with me....I was searching some videos on this topic and every vide were like 40-50 minutes long with 2-3 parts...but you literally explained it under 15 minutes in very efficient way...Thankyou soo much for the video ☺

  • @rakibmarak3493
    @rakibmarak3493 3 ปีที่แล้ว

    Thank you so much sir. after watching your video, every topic seems like a piece of cake and the best part of your teaching style is that you explain every thing. I have seen many video, but most of them just says that binary search time complexity in logn but nobody explained it like you. Thank you sir

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      I am happy this was helpful to you.

  • @varungupta2727
    @varungupta2727 4 ปีที่แล้ว +1

    Better than university teachers!
    Please post more videos as fast as possible.... 😃

    • @codebasics
      @codebasics  4 ปีที่แล้ว +2

      👍 sure Varun

  • @puneetgared
    @puneetgared 3 ปีที่แล้ว

    Best Big O explaination I have ever heard.
    Great job thanks

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      Glad it was helpful!

  • @sd3117
    @sd3117 4 ปีที่แล้ว +5

    Thankfully i tried this vdo... It's perfect for me to learn as a newbie. Thanks!

    • @codebasics
      @codebasics  3 ปีที่แล้ว +1

      Glad it was helpful!

  • @schrodingerbracat2927
    @schrodingerbracat2927 3 ปีที่แล้ว +1

    Bachmann and Landau, the original inventors of the big O notation, never said O(n² + n) was wrong, but anything O(n² + n) is also O(n²), so it is customary in practice to prefer O(n²).

  • @anujmore7547
    @anujmore7547 4 ปีที่แล้ว +2

    Excellent explanation Sir . I love the way you taught in the most simple manner.

  • @altayezekariyas9243
    @altayezekariyas9243 ปีที่แล้ว

    the best explanation i've seen by far

  • @AACREATIONS2000
    @AACREATIONS2000 3 ปีที่แล้ว +1

    what can i say instead of saying thank you ..so much respect for you sir.

  • @iammomoha
    @iammomoha 2 หลายเดือนก่อน

    Finally, got clarity… Thank you

  • @fengshengqin6993
    @fengshengqin6993 17 วันที่ผ่านมา

    Clear and nice ,easy to understand .

  • @Jeretin_YT
    @Jeretin_YT 2 ปีที่แล้ว

    Thank you, I think I might have understood it now. You might have saved my school task.

  • @gianireyes405
    @gianireyes405 4 ปีที่แล้ว +2

    The world needed this video, ty bro

  • @vivekanandank8123
    @vivekanandank8123 3 ปีที่แล้ว

    Thanks a lot for the video! I never seen such a clear explanation for 'log n'

  • @shwethakamath8509
    @shwethakamath8509 3 ปีที่แล้ว

    Very nicely described, referred many blogs before this nothing is close to this.

  • @_sr
    @_sr 3 ปีที่แล้ว +5

    9:19 -> you messed up here. up to that point, it was all going fine... (n/2**k) is not the number of operations. it is the number of remaining items. the number of operations/iterations is "k". but it is still a thumbs up. cheers.

  • @prasanthbab1
    @prasanthbab1 4 ปีที่แล้ว +16

    Could you please make data structure videos for non programming and non math background students as well because few times it is quite difficult to follow your terminology and explanation.

  • @hemanthdev8882
    @hemanthdev8882 9 วันที่ผ่านมา

    Great video, one assumption is the list has to be sorted in ascending order before applying the binary search. Thans

  • @Gupta.Shivani
    @Gupta.Shivani 3 ปีที่แล้ว

    You explained so simply. Great Work

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      Glad you liked it

  • @ashu629
    @ashu629 4 ปีที่แล้ว

    sir what can say you are just awesome i am learning everything from your channel DS ML and Data structures... Thank you so much

  • @karthik5369
    @karthik5369 4 ปีที่แล้ว

    Mathematical explanation is superb

  • @MartinKariuki-c9k
    @MartinKariuki-c9k 9 หลายเดือนก่อน

    for i in range(len(numbers)):
    for j in range(i+1, len(numbers)):
    if numbers[i] == numbers[j]:
    print( f"{numbers[i]} is a duplicate")
    break

  • @hoatruong2474
    @hoatruong2474 2 ปีที่แล้ว

    Best explanation ever. I understand it immediately

  • @Sam-yj7wq
    @Sam-yj7wq 4 หลายเดือนก่อน

    You explain stuff very simply - new sub.

  • @artiverma1402
    @artiverma1402 2 ปีที่แล้ว

    Hats of to you for explaining in such detail

  • @shaiksuleman3191
    @shaiksuleman3191 4 ปีที่แล้ว

    Hi Sir,Your Explanation is crystal clear.No More Questions

  • @markmariscal5111
    @markmariscal5111 4 ปีที่แล้ว +3

    I have an interview Monday and I am glad I found this great resource today! Thanks so much! You just earned a subscriber and I will let my friends also know about your channel.

    • @codebasics
      @codebasics  4 ปีที่แล้ว +1

      Wish you all the best for your interview mark 👍

    • @markmariscal5111
      @markmariscal5111 4 ปีที่แล้ว

      @@codebasics Thank you so much!

  • @fahadjavaid7126
    @fahadjavaid7126 2 ปีที่แล้ว +1

    very well explained

  • @joelngige5776
    @joelngige5776 7 หลายเดือนก่อน

    Nice explanations to understand data structures!!!

  • @dgrave3
    @dgrave3 หลายเดือนก่อน

    It is a wonderful video explained so well 👍

  • @hayden3774
    @hayden3774 2 ปีที่แล้ว

    Excellent teacher! Am going to watch all of your data structure videos

  • @S84-d1x
    @S84-d1x 3 ปีที่แล้ว

    thanks a lot sir for helping me with this i am a high schooler big i still understood it cause of your crystal clear explanation that even coursera was not offering

    • @codebasics
      @codebasics  3 ปีที่แล้ว +1

      Glad you enjoyed it

  • @kunaljha5
    @kunaljha5 3 ปีที่แล้ว

    Very good approach thanks for sharing

  • @devpatel20
    @devpatel20 3 ปีที่แล้ว

    Very Nice Lecturer about Big O Notation 👌. My College Professors needs to learn From You sir. Myself Dev Patel , You are Also Patel I know

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      🤗🙏 dhanyavad dev, comment karva mate 🤓

  • @JINAYJain
    @JINAYJain 10 หลายเดือนก่อน

    to get the square of any number you can also write this code
    def square(number):
    result = number ** 2
    return result
    result = square(5)
    print("The square is:", result)

  • @mamadouaw3129
    @mamadouaw3129 ปีที่แล้ว

    the best chanel I have ever encountered , you are the best . 💜💜💜

  • @adarshkumardwivediietstude8703
    @adarshkumardwivediietstude8703 3 ปีที่แล้ว +1

    Great sir thank you from bottom of my heart✌✌

  • @mileruiz1
    @mileruiz1 3 ปีที่แล้ว

    Thank you Dhaval , very nice explained!. I understand more in your videos than when I was at university :)

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      I am happy this was helpful to you.

  • @kirandeepmarala5541
    @kirandeepmarala5541 4 ปีที่แล้ว +2

    Really Bottom of my Heart, Appreciating Your Work..You make things Easier

    • @codebasics
      @codebasics  4 ปีที่แล้ว +1

      Glad to hear that

  • @itguy77
    @itguy77 29 วันที่ผ่านมา

    Clear and simple 👍🏻

  • @DeepakKumar-fj5jn
    @DeepakKumar-fj5jn 4 ปีที่แล้ว

    Giving example with each condition is helpful to know how and where to use which data structure ... appreciable sir thanks n waiting for more videos 😊

    • @codebasics
      @codebasics  4 ปีที่แล้ว

      You're most welcome

  • @wisdomwizey6077
    @wisdomwizey6077 2 ปีที่แล้ว

    Thanks a whole lot, but please add “space complexity” in your title for others to know you gave a touch on that

  • @alexd7466
    @alexd7466 2 ปีที่แล้ว +1

    In 20 years of programming, I have never needed this in practice.
    Just recognizing nested loops is often enough. In practice you always need to find if it is acceptable, because often it is not an issue! and if it is, then simply iterate. When interview questions are about this, then I know it is not a experienced developer. We can see that in this in this video as well:
    using range(len(numbers)), and iterate by index is not something a python developer should do. ever.

    • @vexed3185
      @vexed3185 10 หลายเดือนก่อน

      You're right, I don't get it

  • @shobapandian3820
    @shobapandian3820 2 ปีที่แล้ว

    very nice explanation.......learned it clearly

  • @shivasutube
    @shivasutube 7 หลายเดือนก่อน

    Thanks...clear and concise explanation.

  • @diogodds
    @diogodds 2 ปีที่แล้ว +1

    The video is great, as many other videos in this channel, although the space complexity explanation was a bit confusing to me.

  • @vijayreddy-nj1tu
    @vijayreddy-nj1tu 3 ปีที่แล้ว

    superb.. crystal clear explanation👍

  • @divyanshidixit352
    @divyanshidixit352 3 ปีที่แล้ว

    Beautifully explained 👏👏👏👏

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      Glad it was helpful!

  • @manikandang7864
    @manikandang7864 3 ปีที่แล้ว

    Very nice tutorial sir. Please continue this good work

  • @manishv963
    @manishv963 3 ปีที่แล้ว

    Great explanation

  • @ousmanekaba8808
    @ousmanekaba8808 2 ปีที่แล้ว

    You are the best sir

  • @lizzard2023
    @lizzard2023 2 ปีที่แล้ว

    This the video that has help me the most ever

  • @ndilionel
    @ndilionel 2 ปีที่แล้ว

    Thanks so much. I really enjoyed this video

  • @craignyatondo5521
    @craignyatondo5521 2 ปีที่แล้ว

    Thank you, you're a good teacher!

  • @santoshshannu1171
    @santoshshannu1171 2 ปีที่แล้ว

    very good explination

  • @naageshk1256
    @naageshk1256 2 ปีที่แล้ว

    It's truly wonderful explanation 🙏 thank you so much 👍

  • @oneloveafrica8860
    @oneloveafrica8860 ปีที่แล้ว

    best explanation 🗽

  • @rakharozaqtama3467
    @rakharozaqtama3467 4 ปีที่แล้ว +2

    Thank you for this video sir....
    Great tutorials !!

    • @codebasics
      @codebasics  4 ปีที่แล้ว

      Glad you like them!

  • @__________________________6910
    @__________________________6910 3 ปีที่แล้ว

    Sir, you are best .

  • @binarytv2904
    @binarytv2904 3 ปีที่แล้ว

    Wow! Thank you so much my firiend :) Finally understood the concept well !

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      Glad you enjoyed it

  • @aminpooja1230
    @aminpooja1230 3 ปีที่แล้ว

    You teach very nicely 🙂🙂🙏🏼

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      Glad it was helpful!

  • @cooktechchannel8385
    @cooktechchannel8385 4 ปีที่แล้ว

    Thank you so much for wonderful video about Big O Notation and I am searching for long time,Finally I got correct guidance about this. Thank you Once again

  • @RehanKhan-wj5bd
    @RehanKhan-wj5bd 3 ปีที่แล้ว

    thank you sir for explaining the rules.

  • @pandaparas8500
    @pandaparas8500 4 ปีที่แล้ว +2

    Very well explained... Sir one request, please also cover examples on all of these.
    Thank you

    • @codebasics
      @codebasics  4 ปีที่แล้ว +1

      hey Paras, I actually have example code snippets for each of the code complexities. So not sure which example are you looking for?

  • @visionboard3842
    @visionboard3842 2 ปีที่แล้ว

    Hash table is really good to take up the data

  • @uchihamadara69690
    @uchihamadara69690 หลายเดือนก่อน

    really helpful video

  • @davidmur7144
    @davidmur7144 3 ปีที่แล้ว

    Beautiful.Well-structured and easy to follow)

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      Glad it was helpful!

  • @gambool-
    @gambool- 3 ปีที่แล้ว

    thank yo u from somalia you helped me a lot, thank yuo once again I wish you best of guidance in your life

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      Glad it was helpful!

  • @mysteriousgamer497
    @mysteriousgamer497 2 ปีที่แล้ว

    took a little bit of time to understand but I succeeded (thanks)

  • @mehediafrin1805
    @mehediafrin1805 2 ปีที่แล้ว +1

    Nice vedio

  • @techy912
    @techy912 2 ปีที่แล้ว

    thanks a lot for detailed explanation

  • @abdurrahmanshabbirahmed9364
    @abdurrahmanshabbirahmed9364 2 ปีที่แล้ว +4

    Sir, your python training classes which is launched last month is more than amazing, thanks for your great efforts. Just asking, can I get a tutorial series on data structures for C language.