0% found this document useful (0 votes)
27 views25 pages

Notes 1

The document describes algorithms for sorting and finding the minimum and maximum values in an array. It includes pseudocode for selection sort, bubble sort, and algorithms to find the minimum and maximum values. The pseudocode demonstrates initializing arrays, using for loops to iterate through the arrays, and comparison operators to reorder array elements from lowest to highest value.

Uploaded by

Shyam Desai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views25 pages

Notes 1

The document describes algorithms for sorting and finding the minimum and maximum values in an array. It includes pseudocode for selection sort, bubble sort, and algorithms to find the minimum and maximum values. The pseudocode demonstrates initializing arrays, using for loops to iterate through the arrays, and comparison operators to reorder array elements from lowest to highest value.

Uploaded by

Shyam Desai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

. .

Al-- at ~J;
0- .UV\

c_;nl \ in{
0 ~,000 ~10~4

1~ r IQ > I ~~ I 1,0
0')(. l O o ~
I a (o1 ~ 10 , au 1~ -2.0
R [ ~ 0..\.'2..) -:. :>0 ·
" ()"( \ t>OO O?C\ tjO be-
~ ~ :(i 'ML i~~l'I ~ ~ vohu_ ~ ~~
• .m1 a.es J __ {, o , (3J= 20 , ~ } i a ~\
O 1 1. _...l¢ ~

r \ 1o_fiJ~.\ ~oJ
0,1000
0

'~ a(~t)J-::: ( 1tl, [~(\~] ~ eo, 3o\~,


C ~ · - - t"9 Lf C\,
[ IO \ \ ] : l '2 0 \ 'J O \
°'~"°
~ -litru t)lfflabt~ WR.~ Akljl. ~
tA>~

• · btl a.[] -= ( Lo, 'lo. '.\o }~


'0 1 2..
ruu,,
Cl.➔ { 1L> f 'J..-0 ' lo ]
°'t0\10
• inc Cl.(-i]-= (to, '20, lo}) ) ~
• \~ a.:c~) ~ { ½ ~»or..ot tAfuru-t oru. valw. ~ ;to- k
~,w,ruhd.~
• i~ a.(~J .{St,
0 ' ')..., .t.?. "4
a. ➔ I 2 l
cxto~
O \ o , o 1 o \/( ;a
~ t~ Cl(~] ,<o}
0 ' 2.. ~ '1
cv' l~ltl)O
O
\ o\ o\ o~oj
{ a. (1 ..( 10 t 10 I ~ Q r ' '\.
1
:(\ I
~. rfl'<£Ccz.(1J) ;
-~ c ( lO- l.01 tp J
t{ •

lltd a! finlt'!' sc_altn~.


~
~lY' J d i.£. stw>f dat-at1w o.{
,. l]~oui\
O'(..\UJO
tp
P:-fk'!>
· ~ H>~O + 3 . ft. • I O\ 2-

~
t.J~ <jWt .t'1J. \fCWil ~ ~ ~ WWn IN{ >tu/\ 'l\\t_~ -
' • <l.[i] r #(Q.+t)
4Cl.[i] =- Ca-ti)
• et[i1 -= rfa➔ i) ~ - - ->
t(Q.-ti -d)
~ Q[;] = a,r; - _ ➔ (CA ·-ti •d)
• l'l1tfui0 _g~ ~ hwu. -WJN~o-r, t!v. ~ \Jo.Lu
~~ ft M .
-main()
l
-
~(ll1td\J\", 0[2])~
t0 M\r\\', °' (;l)~
f a t~I)',

• l-tlf)
", a.rt 1) ~
~ f1d" Mm\ and ~ ° I ) ~. .
IO"'\" 20 -+ ~o : -6 o
1, -=- 20 .. o C~ )
~ Mf(ll-
Q~ ~ ~,
~ cwg ~ (dwlu ') <; /N\ ;
P'cmA\ l•~=- fol~ \n'', a\/1)~
.,

~0 , ,
r
votd ~~ (\nl: aC1, m!r N)
\

}
r
0"')(6000
[o,c\o~}
01Q~
,Q
rp
65 N

ro~;
1nl-f;
i03; i-t-+1
f~(" ~d\o", a CU);
1
\'I'll" .(UJ'I\/\~ ( ir1J a ( J , 1Y't rJ)

{
f"t't i ~

t
11'! ·&,U/1\ ~ Oi
Ci~ o·, t<N; i.-t-t)

~ ~ I.UN\~ o ca;
l
~ MJl'n~

.....,...< ctdlo.h;>
Cillr CJ, in-t:):,
J' mW,
Wli
)\ J \ ·,
1~\ ( i -: o ~ {t.. n ·, i ~ "' )
,!Cl\J\\ l''tel'', £a. t O)·,
}
.,
\Ibid. d.isp~Array (!hl a(J. int n)· 12_ t. 2 1 t.--~
LJ_r l f T--LJ.J
( ~

int,;
~ ( i =o ·, i <.n ·, i-t +) ,lQ [i] ::(z~ i)
pniYlk1( l(1cl\n ". a[i] ) ; = i ·cf
Q+
}
it mt1AAnlly{int a() , h1tn) =
~

re ft]
~,o~t 2.c4;
Ox.10~8
~ ;r(a.-~ f J
·iY\t ma~.=:- I.NT- M\tJ;
~ Li= o ·, tl n; i+'t)
t
.'(a.(i)> ~~)
m0/1. :=- ao1 ~
1

\Ylf ~ r: ~f\/t- MA1.;


~ Ct ~~ -kn; ii-t-J
{
q laCi]<m.n?
min~ a(i1 i
tl..i.'
rd

}
)Af ,iUlltlh (}~- o_ (] 1 7n} n, inl ~)
{ .

(I\} i;
"'\e\ ( f~; t(n; i+19 J
{
fl Cl Cl] =- ·=~)
~ii
)
l.tb.lhno;
}
~
~ton.
fa/a.h~¼.ip Plw ~ · ~ ~ -sodid ,( w. ~ f®"
\ ~o \ 1.1 o \ t\l ~ i j
-mcoGld:r'
A. du.°tl r ~ wi-b. numl'Vf 7 ° +-
3
N - 1- r
dintui.l\ Sfl ':lJ.,J. · i N -1 - i
J ➔ ~::u<n Q 1W71.l~ at tnt\l ill :i. .2. N - , -i
1-., W'i(&'tf.t:4 J,\.\JM. I f- !> 1.. N , I - J°
~f- • 6 ~ 4,-0 Iv - I - j
~
...
,=- ,,.........,~ ... (r=o)
(1foJ > ct(i) (Falu)
ar1J ;> ar21 cr:o/M)
ar21 > nf'; ~
,JIA'.llf ar, 1 , a (3J

/ 10[ uoj co i 35\ ~ J

{1L ~J > Clf 11 .

;.illJQb:~~
,··a[U1
.~W Q(~)

➔ "I: tw 1ftJ7 ,r'O'f\.t ~ A -1wrbrl


-> W.t elf!WV JJ,v t
- ;, &m,f'Q, rttrakon ( l ~ 1.)
l 11Vol I ~w ] 10

{J~ ·O.Co'J >- a nJ ~


o~r- ·, .
~\ ,;-L~-~\J:j

~, t/11 ~ %~ itJl ttlfun £v.ro thr,un;, {)JU /2{}tfd .


'.,d.·(tl ..,, (1 - 2..)
,,~
01__.-,-o. - :(u-.o~f-~o-J-12._~J
o [oJ > ac1) CRilit)
o.(i.1 > a.C 2J TJau.
~wOf a[ 1] , a DJ .

sftl~ ( A!dio-~)
~oicl ;oo.d./Wt.OAj Ci 111- CJ t rnt-) i
vvJ. di!rWJ f\Jtw/{int CJ. crt,;
VO~ ~OJJ- [1n.r-[], 1~i
1;,J- f"'{ll() ( ) ,I

{
\J c).d. .l'ttl{u le.tr.I ( ,·,v a [ 1 , ii,J n)

I
r[ , i~~ r.-~
id i;
0 ~ (,<_ n- I ; { ~t)

I -f
/1.clwf tu.tmlt'{ f paw ..aivJ. UYf
(G't (j :-0 ~ j ~tH~ ; j f -,.)
f
t~ (a. (j] >et(Ji1])

1myi ~a fjli
aCJJ ~aCjt.iJ;
} a_ Cj-t 1.1-= hnyt ;

L~
• /w.JJ<»f XJ1JJl iw. ~ prd- ~ Ah YIJ,UM~ YYUM°"f'
~- '

/I ~ ~ ~ ~ k dfXPU. at .-tip. f ven. tn 1eu.


{l1tv. 'OrPi,,} '
~441\AlftmlJ
~ JknuJ u~ ~L 1/JJI. · ~ 1-"ux.t J/iJ/P> W) Jmut.
~b,i.t4"1JU·
i,,,. ~ ( }

' w a.[too1;
\rtN;
~ ~ ''. l n'r,
~Cs,.,n'li
~J.nl ·•
4N ~v&J.L ~ , r.,,r;v l-"thJ, 2t",._ ,
I J.IJ.AJ.l fJ. 4t,. 4) r 11 it h/J;J
ara. i.J W "-4-w.rn, et,1<1."
~'\ .l t. ~ CJ• 1• '-.N •, 1+-+) l"'-rlu llrd J "-",:J. f/ !fa~ :·
kf'() J

{ 1'1 <. 11
~, l ;. .l ·, ,1CtJ<aCj1
I°' ( )~ i ~ ' ~ j ( N ~ j .. ~ ) P"W -,,d ~
l -, Ju(~LW.b tl.u. ~
~ .
{ ;( ( a. uJ <a CJ l) I~> VJ.
Q c,' ~ c1_t:, -J.h,,(-l11b,,_
(dr M '"' r
\ ,.,,,."1
~
·Jj
/J UJ t ".1 ( f J ~ J4- ♦ rt.,J'it
l .., o ; ~,., "'" OJ/~m,,,&f't1 "h tr ~"
j ij,, lu.dvA ~ ,,.iu 'j
-J.llk»,,
· i,L , 1
~ (l : ~j.)
L} f ~LII "l•d\n~ I (l nJ) j
_.___c.r-4~~.i ,,AA~

t 1l__~_ -:- _!l_-1\ 21


/;>,;' ·c.
~ ,., /). r ,r)ft' j •~· l<AJl'I ( : 0 'f )() r,,,,.r
J\H.N'litll ,i.J, 17 /J. rwml.. o/"' . U ~ -.tl-11
,.(D.lr! .nr~ t( "'~ JUpt,01-,4.
#· ' 1 ~ . ( ~ ,',\
vwJ, ~(l"ld- C1, inHi
1'+ fV' cJ..uJ, ' ~ -~ >
~ ~,~ ( lV\t CJ , t,,f '1
j" ~~(Mf-)j
, Y\t- t ~ \ rJ N\J. ( r'<'J n)

\
t'<\l- ' -)

io>-. <1 ""' :! ·, ic:.. -= ~ v·J en1 ; r ~ -+ J


{
'·\ ( '\,-\ •/-, j :.- ;: 0 ) •

)W..U,'-t'l O j

~au.~~~ 1 ~ ~~ O
-¾\ f,\lluru < s\<ilC' •h>
.-ro', d. run.cf,,~ Ci -rJ: ~ J I i V\:t ~,
\¢Cttl ~, -~ -C- \~\: 3 I -,~J A-) j
~,~u1.~lao.. C1,'\r u.__ ti\! n )j
f\ ~ f a.---fl} 'I'>~ ~ ~ lo iA ~ L11 W-) j
~(1q
i•* ,,\011\ ()
,J ~fr1fott ( irJ
~()lO -
(). [] I jf'J }1 )

{ i8'1- (i-= C>: flt'I; iH)


l£r,u1;. ~"T
yt(o.(n , Ll
Q..Ctl .e-'t_1;
k
f 4S tsf>~ ~J)~
£t-lf t)
,--..:•J ,.,. I
,--.t 11 r f _, ., J;
,,,- n·,
J(/lr,i(" td", Jn)~ 0

~'( rnrt" '\)(,(ljj ( {) I Y) ~ ');

\) - rra~\,r"3 ·( tl , " - 1);


·f~iYtl\ (" 1.a\n'', ~);
Jttl~~I') o~
J
;y:}- ·r ri\~~(,w. alJ 1 irJ m)
{
i,\, ~: m4 ,;

i,. .A '1 ~ ( '1 -t-\) /2 j


S -:
tnt- tWl"l ~ o;
"\t-\ (f-:.,o•, km; i-t+) ,
~um~•~ +t,tti)j
:ul'Wtn S- .Lum;
I> AA A. ,::·0 I A" 0 ~ 0A ';.~ --------,---............--,___,,......_
,,#, U-1,t- o , l'Ylt ) i , 1~
,~~ul)
\~'V.tvr

\ .A tc-·o.1 1-000];
~yv- ' 0 ,.
r. 1--()I )
~ l v. ·/,d- ,1 1Jn);
~ ~ Lo, ~);
a~ oMl~t 0l i .
yJttilk\- LLI 7, d\ rl'' , O) :i -
}
tfl-r ,¢d u1'lk- aT1 , fvth\J
l {Y\t Awn 7 0>
~ Cl -cc O ' , l lJ'Y, 1-+t)
/yJj'('\ '-:) ~ I\ (}_(tJ )

~ M,lm ~ ;
-} .

)~d- ~~ ~MkAN-1.a. rwnhu,


W
rv ~ -~<l"f\ '. l)'YWW iU{t lh.t btk '.
rHl-,u ,et ~ ~ .
~f~ ~~,at,W;.
Y'\ :: :l,& .-;. ~ \ 0 0 (0

~n--t ';:.i1~ ~ I 01 \ I
Nlt'\ ~!) -=- 0 I OV 0
· Ju!:- 'n t ( ev ( n- l))
11...-----------~-
! Q) WJtih i>- ~ C ~ Ao Jiild ~ odd Otl)J}(JJ.00
, -~ r ·-· . ..
Jf..f..11»..

') 'I-_~( f\~ ,a,llJ,k~


·I 1 I' g, " U " ".!3
/.,.f A3
'i X}A ::: 1 "' ifli~,4\ ;{' (\ 5
,. :L~ s ~ 4
A:- iov ~~ 1 - i s ~ , ½ ~i.
~~ey\'\ ~~ ~ t0 w ~ J(Will;{~) n'\D,kLko~.
tUNs ~ NW-.J .,w--YVJ)1W}I, i-aMd- -Md. oHtvt M ~
': ~ ~ rM ll»,U- '
, 6\>1\/1~ 1- wW,._k J!fJIJ uk- ~ 6 ~ if\ ''Y\!O'Y\ ~ I{},
; ...,. 'fu MJWW -I{ k'M. ~ ~ C~ JJAroVt ~,,u W- Q/1 MJlPr,
1 JJJI._ ~ ~ W'»'W ~ ~ /M'I ex~~ ~ ~fU4
II Jt- ~ Of\1~ d . ..
. 00\ O l\
~C)Q 100
0 00 cQO ___
> _, ?
" ~ iw_ I'QR. '\ jio\-t-d.thoJIOl · · 1 , , ::: f . .
YY(/'(\ OJ)t}O ..at~ m,o V\0'1\ ~
. . .

~
I ·'I
I I
; ·1
: I
~(t\'1K o..CJ ,tl\k"h)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy