Shundan keyin bu elementlar o ‘zaro o ‘rin almashadi (6-rasm).
p iv o t R | 3 I 2 | l l I 5 i d ; I 0 1 2 i 9 114 12 0 ]
I
I
l e f t arrow right_arrow 6-rasm. Ikki element o‘zaro o‘rin almashganidan keyingi holat.
Almashuvdan so‘ng, “right_arrow” chap tomonga qarab, to
chegaraviy elementdan kichik yoki teng bo ‘lgan element topilguncha
surilib boradi (7-rasm).
p i v o t
M | 3 | 2 111 1 5 1(|? | 0 1 2 | 9 114 |20 |
I
I
l e f t arrow right_arrow 7-rasm. 0 ‘ng tomonda o‘rin almashish uchun element topildi.
“left arrow” indeks o ‘rin almashtirish uchun zarur b o ‘lgan ele
ment topilguncha o ‘ng tomonga qarab surilib boradi (8-rasm).
p iv o t | 4 | 3 | 2 | 11 | 5 | d ) I 0 | 2 | 9 114 | 20 |
I
I
l e f t arrow right^arrou 8-rasm. Chap tomonda almashish uchun element topildi.
So'ngra topilgan elementlaming o ‘rinlari o ‘zaro almashtiriladi
(9-rasm).
p i v o t
1 4 I 3 I 2 I 2 I 5 | ® | 0 I 11 I 9 |14 [20 I
I
I