Analysis of Quick Sort Algorithm | Time complexity of Quick Sort Algorithm | O(n^2) | O(n log n)

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.พ. 2021
  • This video will give you an in depth analysis of quick sort algorithm.
    Best case - O(n log n)
    Worst Case - O (n^2)
    Average Case - O(n log n)

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

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

    Hi all,
    If you have any doubt or query, feel free to write a comment ✍️ to clarify it.

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

    Ma'am Your Explanation is the best I've found compared to websites and other videos .

  • @rishipollai5646
    @rishipollai5646 3 ปีที่แล้ว +6

    One of the best lecture ever , 🔥 always I am bit confusing with time complexity , now it is totally clear 🤗 thanks to u mam , I really appreciate you efforts 🤗 keep doing such good explanations .

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

    completely understood!! nice and clean video.

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

    Thank u so much. I wasn't able to understand this but after seeing ur video finding time complexity seems easier.🙏

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

    The lecture was to the point with proper information....Goooood!

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

    Completely understood!
    I have never seen such a clean explanation about complexities of the algorithms.
    Please upload more videos especially a playlist on learning complexities from basic to advance problems.

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

    i am very thankful for this

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

    Thank you so much for helping me understand this basic concept :)

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

    you r a good teacher 😇😇
    Your teaching skill is way better than other😄

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

    you're the best ! thank you !

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

    Hi!!! You're helped me a lot, your video is very clear :^) thank you ✨

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

    a very clean explanation mam

  • @asdf85817
    @asdf85817 5 หลายเดือนก่อน +1

    Thanks!

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

    Best explanation ever

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

    amazing video thanks

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

    Ma'am your explanations was super clear, and highly expect such a good analysis for other algorithms too :)

  • @ashishksinghal
    @ashishksinghal วันที่ผ่านมา

    Can you also provide analysis of decending array worst case

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

    with n=8; is there any chance we can generate best case array for a quick sort algorithm, please clarify? thank you. for example, we choose pivot as middle of array.

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

    please do video on average case analysis for quick sort

  • @kuchipudivijayrahul3296
    @kuchipudivijayrahul3296 6 หลายเดือนก่อน +1

    I don't know why your channel has few subscribers

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

    Mam why are you not uploading videos

  • @AnuNaik-nu2ct
    @AnuNaik-nu2ct 7 หลายเดือนก่อน

    mam for average ,when we say quicksort algorithm is average

  • @LokeshKumar-jg8md
    @LokeshKumar-jg8md 3 หลายเดือนก่อน

    Nice explanation but where's the AVG case

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

    Space complexity?

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

    so does that mean that the worst case will change to nlogn if we take the median as pivot????

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

      It reduces the likelihood of worst case scenario, but does not guarantee to O(n log n) always, because median is depending on the distribution of data and to select median again sorting is required. Hope it helps you!!

  • @KandhaMaaran-10
    @KandhaMaaran-10 2 ปีที่แล้ว

    Mam .. the array is already sorted then it might be a best case.. this is only you teached in last vdos but here the worst case is in the sorted list and best case is in the unsorted list .. I can't understand can you clarify..

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

      @NK Every algorithm is different from each other. You are not blindly say that all algorithm's best case occur for only sorted list. Some might work well for sorted list, other might work well for unsorted list, depending on algorithm's behavior. This quick sort algorithm does not fit well for the sorted list because of the pivot element it's choosing & it's working behavior.

    • @KandhaMaaran-10
      @KandhaMaaran-10 2 ปีที่แล้ว

      @@cstalksbylee4434 thank you so much mam now its clear🙏

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

    Mam Average case?

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

      @NANCY M For average case also same steps only but you will not get evenly balanced partition like best case( always n/2 elements in left and right child of recursion tree so all the leaf nodes will be in same level). So in avg.case you will not get log n base 2 levels instead log n with some other base value, anyway that is differ by constant value only which will be ignored in asymptotic notations. So we can say O(n log n)

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

    Mam please upload full DAA

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

      Follow this regularly I'll be uploading DAA from basics to advanced level. th-cam.com/video/1Zr0Z3Hvzxg/w-d-xo.html

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

    What abt average case mam

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

      That is also O(nlogn) only..

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

      Nice explanation 👍

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

      Mam average case time complexity will also follow the same steps like best case?

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

      @Hummair khan For average case also same steps only but you will not get evenly balanced partition like best case( always n/2 elements in left and right child of recursion tree so all the leaf nodes will be in same level). So in avg.case you will not get log n base 2 levels instead log n with some other base value, anyway that is differ by constant value only which will be ignored in asymptotic notations. So we can say O(n log n)

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

    Aoa , plz tell me [n(n+1)/2}-1 what is this?

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

      @Ghjk Yuio sum of first n natural numbers when starts from 1 is ==> [n(n+1)/2], but in this worst case, the series is starting from 2 not 1, so subtract 1 from it. ==>[n(n+1)/2] - 1.

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

      thank you very much such a beautiful video of all lactures of all time comlexity.

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

      Plz add more video like merge sort heap sort etc..

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

      We'll upload soon.