QUICK SORT / CS3401 ALGORITHMS

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.พ. 2025
  • #quicksort #algorithms #cs3401 #sorting #divideandconquer #datastructures

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

  • @swethas6921
    @swethas6921 8 หลายเดือนก่อน +1

    ❤ thank you mam 🎉

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

    🎉

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

    Mam one doubt the right array is not possible to arrange please clear the doubt

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

      That is 50 60 55

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

      50 is pivot. But 50 is already placed in its original position. So again it is divided in to left 50 and right 60, 55. Now you have to sort 60, 55.

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

      Now 50 is pivot and 60 is I and 55 is false then first condition is false so we go to j then it is true we decrease then I and j have same value and again we check the I condition is false and we move to j and it is true we decrease then p and j are same value

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

      j and pivot in same position. So 50>50 condition becomes false. Decrement j. We can't decrement. So swap pivot and j. But Both at same position so 60 and 55 is separated from 50. Then sort 60, 55.

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

      Ok Mam thank you