dsa
dsa
Votd puet(;
Ved pep();
ed peek (),"
Frit ")
puntfCd. Paush ln2. Pop \n 3. Peek \n4.
\n);
punty u\n Enter you epuen
Scan (v/d", &opUn)
Lwtah ( eplkon)
Cae 1:
PLuoh ()
beeak
Cane 2
Pop),
beak
Cane 3
pee k)
buak
Catse 4
default
3
(" PLeast Fnlet Valud opluen),
Punt
void push C)
u valu
top= -n)
punt Cln Owhiow")
Pauntf ( Fnlb h
value ?),
Scante/od",3 val)
to tep t1
Stack tfop] valie,
Vord bepl)
IE ( top = -
1)
Puintf C Undeflo ");
te top -1
void beek ()
if cto :
-1)
utpat
Lunta Sear c
Ackuun ii
Lut man ( )
ut ainal]= i2,4,6,0,1,9?,
wtx 1 ; |
ut n izeef (arnay ) /sizeoh ( a2nay lö);
mt msult &earh (May n1X)i
not føud")
(Aesult = =
-4) 7 puntf(" E lmentF
eund a Lnoln /d", suult)
CPleneut
Pain
Ouwput
Bunany seauch esatuue
mclude rctdio.h
t buary Search (2ut ut L
low
avay [1, Lnt x,
uut igth)
mid
(ara lmwd) 4x)
Lew = sd+11
hugm mud -L,
Aetun 1
mam (void)
wt May [] {3, -
4,S, 6,7, 8, 9f}
ud n:
size (anay) / size (auag lo1),
wd X 4j
bunary Seatch ( aay, X, 0, n
-
1);
4 (esuult 1)
puntt (" Wot found"),
Aeaull)
AAtin 0,
Bnary seasch Rensue
low)/2,
(tray Cmid) ))
e n mmd
ud man (void)
h > o.
include rstdi
i n c i u d i ( SHdlib.h>
Stuct Node 1
ut dala
sAkect Node *nent,
F
Node top NULL
vofcd puslh (ud value)
NVLU)
Chop =
=
nent- NULLi
nen Node ->
?
6 op - NULU
ink maun ()
Cae I
Punitf C"\ fnter Hhe valt s
wnsect "),'
Scan C+d", B value),
Puah value)
bteah
Cane 2
Pntt Pophed elcmeut n'f-d \n"Pop ()):
bteaki
Cane 3
display (),
beak
Cae 4
eit Co);
defuult
Paint f C\h Wou cheuce \n")