Visualization of Yaroslavskiy Dual Pivot Partitioning for Quicksort

preview_player
Показать описание
This is showing some of the features of a visualization of Vladimir Yaroslavskiy's dual pivot partitioning method for quicksort, which he introduced in 2009. The visualization is synced with the accompanying pseudo source code.

Рекомендации по теме
Комментарии
Автор

@Vladimir Yaroslavskiy
 Hello,
I looked into the sudo code that is available on above shared link but did not understand this part
ℓ = left+1;  k = ℓ;  g = right - 1;
while k ≤ g
if A[k] < p
Swap A[k] and A[ℓ]
ℓ= ℓ + 1
If l and k point to same index then what is the purpose of doing  swap between l & K
(Swap A[k] and A[ℓ])
Can someone please help me understand this. Thanks!!!

gyanendrapratapsingh
Автор

No explanation of why this is better? Nice visualization :)

RogerPack