Quicksort | C++ Example

Поделиться
HTML-код
  • Опубликовано: 22 янв 2025

Комментарии • 16

  • @anilkumar4u2506
    @anilkumar4u2506 4 месяца назад +1

    Thank you very much for the detailed explanation, finally I understood the quick sort algorithm

  • @RatedA4Aliens
    @RatedA4Aliens Год назад +3

    @3:00 Confused as to why you changed the order of elements when pivot at last index (value 5), shouldn't the order be 5,6,7 instead of 5,7,6 ?

    • @VeronFujimori
      @VeronFujimori Год назад +1

      If you describe the algoritm, you will find that the variable i = low at the 6 and the high at the 5. So, they swapped and become 5 7 6.

    • @dwivedys
      @dwivedys 7 месяцев назад +2

      Had the exact same confusion

  • @luizzzda8760
    @luizzzda8760 Год назад +2

    thank you for the explain this type of sorting. so very clean and help me very much :D

  • @levondarbinyan3934
    @levondarbinyan3934 2 месяца назад

    Thank you for good explanation. I have a question about the last part. We randomly swap the last element of the array, just in case it was sorted already - correct? Why do we want to choose the index randomly? Why can't we just take the middle index between high and low?

    • @Holsp
      @Holsp 5 дней назад

      What if the biggest index is in the middle? You just push it to the back and the whole cycle of getting the bad pivot continues, just from the second iteration.

  • @hanniamartinezadame8125
    @hanniamartinezadame8125 Месяц назад

    Tysm!! This is amazing

  • @Silentema
    @Silentema 2 месяца назад

    Muchas gracias amigo, apesar de que el ingles no es mi idioma, pude entender a la perfeccion el tutorial. like y me suscribo

  • @tsan8822
    @tsan8822 8 месяцев назад +1

    My head exploded sir
    Btw ty for explanation

  • @dwivedys
    @dwivedys 7 месяцев назад +1

    Whoa!!

  • @martin6101
    @martin6101 Год назад

    stary popici to je very good

  • @katlehotsotetsi8335
    @katlehotsotetsi8335 6 месяцев назад

    Thank you

  • @VeronFujimori
    @VeronFujimori Год назад

    thank you sir