Professional Documents
Culture Documents
תרגול 5 דאסט
תרגול 5 דאסט
DAST
Bubblesortfe 317 1311000 03J
BubbleSort ACI in
1 for it to n t
a for jet to n i
i if Aj A j D
Exchange
919293 DEAR
A
92 91,93 91192,93
AED
Ilse AGHA Ilse
92,93191 92,91193 9193,92 91192,93
IS AX
9392,9 9293,9 919293 929,93 939192 9,9392 929,93 919293
renlogn Hh is n 7128
4 for i 2 to kt
9 i I I
5 for ith to 1
a B C A 1 A I
b C A I I
A 1,3 0,3 P
c 388 c 488 c
234 234
B B
O 2 3 xp 7010
c c I L
1 2 34
B B 7,017 7481117
110 30
c I c
234 I 3
B
PD 711170N 8 P 704 110 7307 18 Tree IN p 3 111N
1 for i d to 1
a sort A by the i th digit
using a stable sort
DDD
µ 7307 y Y1X
7 1717107 7370147 71745 7371317 and 01 y of
23 IN evel X y 5 The
7131174 1261172 Pieran 0,1 N Penn at p'S 11d
i
317 131402 Pw
BucketSort A 1 in d
1 B new array of n lists
2 for it to n
a Insert BELAA in 1 Aci
3 for it to n
9 MergeSort BCD
4 return concat BCD B 2 Ben concat two
A I I ink
s s 13,5 5,1
BED BED BC BEY B 5
BC.LI 5 1 BE ok 001
BEL 5 1 BEY He 0 D
I IE