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

24/os2 Date.d.

orn*aneeaoenoenena
Page ********es*toe***

T71-LIay Serck Jree *


taee_(hieh has Minimlni_gne lnd mzamoy
- 1 a l e Cnid min 0 MOx SLKeC
S Called a 1- ay Seauch APe_hare
N HepuesLnts the oadeu he taee
mcs be_chy_inteqe Laalues
u e s _ aOnd
sheald
n d itShbld
in. o
un.
he a

& -C0aySeanch Pree


5

10I5 20

GA . cwaySterel Der

215. 6 78
Date .
Page.paseeo-

Consideu he ode M=2.

husCoe Can Saythat to0- Ocu Sea cla


ree is called ds bina Hee,

E B-Tee
DEsa parl of M-wy Aeogeh txee So
itis_clso Crseatd byteking Some axdez
h M-o0 eosckse ee 13 cclled
aa B- ee_i he Qllooin q o o
Cendli tian oe aplalied
( EXcept heoot amode, wey_Dtheu o ode
suld_have nun. hol vlue P/M
CLndmax - 2
Vales. he
HOot Mpde ma hanue_min1 and max
M- alues,V
|

N
D a t e . . . * oooo
oo*a o * * * * *

Page.*

he muiohA 1salue in he uoc


i2Shi 22desa
Ond Xeate v oAepuw
Oha

io 19 2oL 140us5o
LI
Snseet 22
The pxopek place oo 22s N 20
Thehde ha modinlm m1) alues
ale_hsetlien So, the ihseefed S
Chmloltkd Succexuly , So
Cunent Pree clleu ih&tNkiön
5

1o120 22

SO 12ut hode hr olrecds (n-) falues


Soaensdeh Ulakb Rituogton
oe.s*e**e*osoooo*o*****

Page ...eeeeo**e
o*****

40 45 8 S0 S3
follotas=
Thus he omodo meeds to be spllt o5

Lest E stm-1]}2 13allue


4o 5
iddle=Postfion11 (n-1/2 13aluej

M-1)/2 salues
alRiahi= = Lost
60 STL

5L L l l L

R30L 40 45 So51
IO 50 23

a h t o 5 2 2

Pelelio_in B-aee
pollow the 6llouainq algouithm ak he delepion
olug inB.rkel
Searh fes the rgbey opcde ukiek 1g tobe
deleledtarding ponleol 2odle
he Mode Vhas min mL2 Values ole
delelonhou Hhe_delethams maluy
Gucce&sell.
Date...
Page..
s*****co*o****9*

u)Ae_deleton_£the node has Lessda


M-12 1a4Les hen+h6 ia Called
ndenlno Aikucufrorn
n thi4 cose Ie need Czeak e
Lenmarined mode ay Cozrakahiizg he
1alues_cCutea/ aqode- nuiddie
alue zoot Mede qmd all ualues
meiqhhen o do
Aller tht Shlil he he Comhined ode
a Gollsws
eSt t m ) / 2 alvef
mdd pokilineCn-)Ja values
Riyht Lostm)2 galuek
f t he aiddlzyalue in _he gooBamd breeti
coo Sehrc 920ck eLcutd AIl
v) ouo peufaxm the delelio DOces
n desixed node

Consiedthe $-Way oee.

518

toIslao 30 s4ol
Date...
e e e e e s e e e o o o

Page . .

Relele O
* Ater dektien a04he made ollous the ule_
ihimum_ualue fox 8-1aee So, 0Len kO
eedNOamaly he urleln 2 Tee s o

358L

15 203514045S

Cansitee he 5-a 2-Tzee

Delete 6
(the_pode hos tyndezlao Sikeakikron gte deletton
S So se_eed to, Caenh -Q Lnbined node
Qallo.s
IO1SS30 35 40 4S
adexed tombined_node= |5 10 15 30 3S 40 4t7
2
Date esoonoseeeosoosoeeos9

Page 0sosoDeoeeeaoae*e*

Sha
l =_5 10 S
middl=_30
Rill= 3 4o Y5
Afler saittng nuddle alue În he rou
he Cuwreut B-Pee$ as Jo Mo

20

Noto toe can deleke Is nóamally o


deleon.the cuemunf nade i4a1brud

134o 4s Sosr6
Date

86s/22
P a g e . . . on* *e********e**

Peachinq dazfin
pnding ny daufa
#Seaechinq he rocess_of
ems b ( / edlled
I hAhe ghenAgt o
a Aeuucking opexcuttor,
heneae (Jhao Seut.ching fechnique.=
(2 nean Seavch/Sequeakinl SeMch
1) inazy Seakch

nea seauchi
Ihis technicque benefeiol fo gmallUE
Only but can be sed fox soxted i vnsoxted

ahsCaóe Combaue hesemching elemeut


Lslth eveydata inthe st,CL Ster/ pom
ony posiHon theneithek Cwe en ermide.
4hE Ocess ox Con mae t1end dafa
Thetine Comblerait fox Linea Aebnoh dechrigue
gvuc 4ime osthe Lst
onge
AP toAedrch-any paxtieulax datc in an
aHay

Endude<Stdioh>
#incdude < conio.h>
void main C)
nint_nflo, in, num,f=0,
clasesO3-

Scanf d " en[t)


puintf(n Ende heaeching celement
Scanf ("ZA & num) O
LSearch Ataut fsom hexe

fnum== n[L
pinf"nAote found at %d
posiHon , 0 ;

boeak _

Pinif Data no4 jound


AAM
D a t e * * * .
o e e o o o o e e * * * *

Page ..eroreaooe

elemeut ot he
high_poins to the lagt yhe
Calculerted
List. ond the mid is
Omdamid=_o0+hiah)z-

data n the qiven-


LOP Aeakch any paxkiales
St_o rleme

tinclude Kidio.h
trlude Conio.h
yoid mun )

int nlo i, num, , h ,m,f=0;


CscxCS,-
i++)_
ax(i=o3 is1o;
pHintf n Entet no.in Array
Scanf A" &nf);

pxintf nEnBee Seoschinq_elemet")}


Scanf "%d, num); O
=0
h 9
m=th/2
LOhile =h)

IEnum== h\m
Date oe*o*ao*****o**

Page-.

jffnom n (m1)

hE m-1
lse

=mt1

pin n Dafa nottound

else
bxitf mAaka fbund al2d position
m)
ekehty

DyRun
1o o u so6o7 9le
h m P
Date..or.*****

Page

Cekaygir
data ethiK

oting he
ne_ pace
pracess
eadei 1
in
Calledas Aoatizy fechnicve,
dkchnique -
Ihere Oke 8_Soa 42q
Dubble Soz
Selection Sozt
nseion Sox
Iv Mexae sost
V). Shel Sczmt
Raudiy 8mt
Quck %ot
Heab AAt

9os22

Bubble-St
4 is UsRhil fpx Aoahng cH _Sndll Lits onls because
I s a time Comaoming pxocess takks as
much tinRe_g4 he k e longe

S tctkes fly N-L `ebs aut ol n elements


9£ Deanashe Combaisou of looek inde
data sith neet upber ndezß dataand
tobex indezdata isSmalle ffey_perhom fhe
Suxppiha tgan this proLPskHeßealed._
he wholeKO.LesA LSil toKe_N-I Steb
|E|
D a t e . . o n o n a n n a
o n**e o * * e *

Page.....

techniqve.
bvbble soat
LOAP to Sodt the axay
Finclude<stdio.hz
4include <Conio.h~
Void mncin )_

int nio 1,4

puntfm Ene No InAryi


Scanf "Z', kn O

h i = h [á+1]B

ridf n Sovked -Hst ");


oi=0; i 10' i+i)
2
Date eoseoo e9s90osoo00

Page..9e0s9*94 osee9*6*0eooo

Selecdon Soat
I s st dome os the bubhl fatbut he
dffesence is that SelecfA dond places the
mal lesd data_in h Cosoct pkce 9n eareh
SEbLhexeos bubble sont plece he
aegest data n_ Cosroek ploe in

4
Slep 3
3

Steb2
3
k
|3

8 3 3
34 8
4 4
H

AL.
EEE
R

O
Date e eoceemeeoeseo*

Page **o*osoooa***o**

4 8 2 6 SS
4 4 8_2 6 S

85
pkbj_L 6
Sozted UiE
Hgaithm o Jnserkton_cSor
lnaertionSoxt_ L,n)
whene Represent he lds of Elemenls
n
Represenshe qumber ofemenb

L, 2 3 4
I

N
Date..
Page.

lpolortl LPeinlen
pointey-

Lpoinler+ fomb
Rintf ulep = %d i
fo = 0; K<hík t )

privt[a

Void disp4( inlAI, int n)


in
pxint mSoded Qr is as ollsuos lo)-
fosi1y KEn, i )
panf"ZA", Q[IJS-

Void: main)
int numbele
int0llaJ
int
entf mImputthe ombey lerteuts
in he Li-1
SComtZL Anumber)

You might also like