Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Assignme nt No.

5
Q1Sozt the falla wtag umhess wsbag bubhle
Sozt Selectian Satsezhian Sart
7156 9 45 3a20

)Bubble Sati

Pass 4 7156 945 30,20

Pass 1 56 71 89,45, 3020


Pass 21 56, 71 53I, 3020
Eizst Laap
Pass 2 567 45 20 89 20.

Passá 5671 4s, 30 s20, 31


Pass1; 56 45 71 30, 2069
ass 2 S645 307120,a9 Gecand loop
Pasc 3 G64s 30
4s30 20Z189

Pass 1: 45 S6 30 207139
Pass2 45 2OG6 2 o 1 89 Thid loap.
Pass 3: 45 20 20, 56 Z189
39
S6 71,
Pass 1 30,45 20
Fouzh laog
3o2045 s6718I
Pass 2
Pass1 1Efth laap Pass 2

Pass 3
(o) Selectio Sort i
2 4 5
71 56, 89,45 30,2o Pass 1

Eizst laop -
Pass 56 71 894S 30, 20 a Co]<al

Pass.2 5 6 445
5 89 71 30 20 al1]at
Pass 31 5645 1 , 9 30, 2.0 aC2]at
Pass 1
Pass 4 S6 45 7130 89 20 a31
Pass 2
5.645,
Pass5 5 6 4S 71 30 2039 a CK]
Pass 2
Seco 2d laop i
Pass 1 45
Passt
S6130 20 89 aCo] < Toss s
Pass 2
45307l, 56 20&9
Pass 3
56 7120 89
Pass 4
30S62071 59 aC3]
Poge

Thicd laap-
i
P5511 3045 56 2 0 1 89

Pass 2 30 2o4556 719


Fourth laop
laae
a Co]al19

(2) Tase rtia So2t

71 56 9945

Pass 1 56 30 20

Pass 2 5671 894S 30 20

Pass 3 4S S671

Passbl 304s 567 9 20

Tass 5 20, 30 4S5671 89

1
n0kis where 0Ckm)
0.Ck.n)
isSort Radix Conplexy
af Time S
Sozt
- Radlx (3)Iyterip,
Bor
Selehian_
0Gort
is Caszplexy
of
2
2
l (0-1) Complextty= Tíme
SoxtiSeleetian (2)
0(z sots bubhle Complexi-ty
of Time
0.(o2)
2
2
2-1)
-1)4(n-2)(-3)
t2+1 aping
Got i()Bubble
techaiques. cazting
camplexy tint the CuSs.Q.2)Dis
va o
(4Tnsezhioz Saxt -
Cosmplexity of istrtion sort is0G2)
(5) Weap Gazt -
Tiant Caaplexity of heap Sat is 0(alogs)
(C)guick Sort i
Tone Camplexity ) Worst Case ala)
2)Best Case o(alagn)
(a)lTMesge Sozt
Time Camplet of ezge Gat is 0(2lagm)

You might also like