Quicksort: Partitioning an array

preview_player
Показать описание
This video shows how partitioning may be achieved, as part of the process of Quicksort. At the end of the partitioning process, the array is divided into two sub-arrays. One sub-array contains elements that are less than a chosen pivot, while the other contains elements that are more than the pivot. The partition function should return the position of the pivot.
Note:
While recording the video, I was focusing on moving the pivot to the (i+1)th position towards the end of the video, and in my hurry to finish the video, I had forgotten that a swap is sufficient. Agree (and this has been brought up many times in the past) that a swap at the last step is quicker and more efficient. However, it is not incorrect to shift - just inefficient. Actually, as mentioned right at the beginning, the objective here is to find the position of the pivot for the partition.
Рекомендации по теме
Комментарии
Автор

All the fancy power points and drawing tablets and still the best explanation is a homie with paper cups.

Thank you, sir!

whoopdeedoodude
Автор

I think it's funny how you don't use anything fancy to explain this, and yet your explanation is still one of the best.

diegod.
Автор

This is the best video on Quicksort.

However, at 4:05, we could just swap "Pivit" and the "i+1".

conea
Автор

One of the most understanding videos i have seen so far about QuckSort. Thank you sir, extremely understanding

srishtiavalakki
Автор

this explains a lot why "i" started at index -1. Thanks.

void
Автор

This is the best explanation i've come across!

angelamunyao
Автор

I've never seen such an amazing teaching method, thank you! This is gold

shikha
Автор

I watched your instruction twice, not because it's hard to understand but so enjoyable to watch. Thank you

justdanaus
Автор

Only after watching this video did I understand that the `i` only increments when a swap happens, in effect keeping track of where the pivot should finally rest. The best explanation I've seen on quicksort partitioning!

adilbaig
Автор

not gonna lie, its the best video available for quicksort.

namanaggarwal
Автор

Amazing explanation! Thank you, Thank you, Thank you :) Very clearly explained and the visual aids were amazingly helpful.

estefaniac
Автор

Incredibly helpful. Textbooks and online articles handwaved over partitioning. Thank you for explaining this so well.

ChrisLeeX
Автор

possibly best video on YouTube to understand Quicksort.
Everyone just dry runs the algorithm - without clearly showing what's being done and why.
You won 'em all!

sankalparora
Автор

you are very good at explaining this complex algorithm!
with your calmness it was very easy to follow you step by step.
you are the only one that actually helped me to understand :)
Great job! Thank you!

mapmappampam
Автор

This Legend is replying to comments even after 6 years.❤

aaryaveerrajput
Автор

The loveliest explanation of partitioning ever made.
Hats off to you man!

Mr.SuperMan
Автор

Best explanation ever.
Very clear and crisp explanation and the representation helps to literally visualize the problem.
Thank you !

rewable
Автор

This is amazing! Great explanation. I could not understand quicksort until you masterfully and elegantly demonstrated how the algorithm works.

zoriiginalx
Автор

Usually I don't comment on video but I have to make an exception for this one because EVERYTHING WAS JUST PERFECTLY EXPLAINED....
It changes from the videos where the guy takes more than 10mn to explain it in a way that will confuse more
KEEP IT UPP 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥

fodecissokho
Автор

I wish our college lecture had explained it this clearly. College is where we go to get grades; YouTube is where we come to learn. Thanks KC Ang.

JasonJason
join shbcf.ru