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?
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.
Thank you very much for the detailed explanation, finally I understood the quick sort algorithm
@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 ?
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.
Had the exact same confusion
thank you for the explain this type of sorting. so very clean and help me very much :D
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?
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.
Tysm!! This is amazing
Muchas gracias amigo, apesar de que el ingles no es mi idioma, pude entender a la perfeccion el tutorial. like y me suscribo
My head exploded sir
Btw ty for explanation
Whoa!!
stary popici to je very good
Thank you
You’re welcome! :-)
thank you sir
You’re welcome! :-)