Big O Notation Series #9: Understanding Merge Sort

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

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

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

    Wonderfully explained!!!Thank you for elucidating so much on time complexities. Best video I have even seen on YT regarding Time complexities.

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

      Your comment makes me smile 🙂 Thank you 💙

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

    Thank you. Just...thank you. I'm a frontend dev and I've always considered this stuff way over my head, but it's slowly starting to make sense.

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

      That’s great! Things always seem more complicated than they are in the beginning. Keep it up!

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

    Really helpful and clear thank you so much... 2 min to understand the time complexity is amazing!!!

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

      That’s great news. I’m glad it helped you!

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

    This helps me a lot. Thank you so much!! Love you!❤

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

    As usual you are exceptional ✨!

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

    Good explanation, thank you!

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

      Thank you! I’m glad it was helpful😆

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

    THANK YOU

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

    But when we talk about the time complexity of a recursive program, let's say finding fibonacci series, we take into account the number of times a single function calls itself recursively but here we're doing it in a different way. I am a bit confused as to if we apply the same procedure to the fibonacci algo, how would we find the time complexity.

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

      There’s a video in this series that explains Fibonacci time & space complexity

  • @jubaer.hossain
    @jubaer.hossain 2 ปีที่แล้ว

    Great video!
    Btw what is the note taking app/setup you are using on your iPad to explain the conceptual part of this video?

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

      I think it's called goodnotes but I will have to check later

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

    Something that has been bugging me about merge sort is it classifies the operations of dividing as O(1). However the slice operations create new arrays every time which is technically (n / 2) yet it isn't included in the analysis. Why is this considered constant time?

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

      Good point. It actually depends on the implementation. You can make the splitting of the array O(1) by not actually splitting the array but instead just using the same array and keeping track of where you are in the array by just using the array’s indexes. That is the more optimized way to do it.
      But even if you consider that we are making copies of the array at every level, and also need to touch every element to compare values, it is still O(n log n) because O(2n * log n) simplifies to O(n log n)

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

    you're great. thank you

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

    Why are we considering level of operations instead of number of operations... It seems that time complexity has to be O(n.2^n) right. Like if we compare this tree architecture with the previous video, O(2^n) complexity looks more relevant than O(log n). Please correct me if I am wrong.

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

      The tree will be comprised of log base 2 of n levels. At each level we need to touch every element of n. So the time complexity is number of levels times n. So O(number of levels * n). number of levels = log n, so time complexity is O(log n * n) or O(n * log n) or O(n log n). Does that help?

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

      Got it. Thankyou very much 👏

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

    Thank you for this. I was wondering what programs and software you use to write and record your desktop?

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

      You’re welcome, I’m just using the screen recorder that comes included on my MacBook

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

    Thanks!
    do you have any video on the Quicksort?

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

      Not yet, but I’ll add it and the other sorting algorithms to my backlog 🙏

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

    1 min wasted for opening a box

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

    4:10... time to eat something =P