0% found this document useful (0 votes)
39 views16 pages

DS - Practical - 3

This document describes a stack data structure and its basic operations. It defines variables to store the stack and the top index. It also defines functions for pushing, popping, peeking, checking if empty/full, and displaying the stack. The main function demonstrates using these operations on the stack.

Uploaded by

Soha KULKARNI
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)
39 views16 pages

DS - Practical - 3

This document describes a stack data structure and its basic operations. It defines variables to store the stack and the top index. It also defines functions for pushing, popping, peeking, checking if empty/full, and displaying the stack. The main function demonstrates using these operations on the stack.

Uploaded by

Soha KULKARNI
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/ 16

PR AC .T\ C.

A L ~\o 03

i- -- -- - '1heo~~ ~ ~ ~ ~ ~ -
S\-a..c k :_~- ~ " ~ - - = ~ = - - ~
_ _ _.....,_-_ 1 ~t:Qct\ lS (U.') o.l\cte)-t~cl
- - _ _d.e nle nb i- m ~ tle..
er
c.o\lec.\\QI"\ e\e. ffi~ 'l\t$ in witlC.h ~
l~':>.~r-e.d c-!r\ oe.\e\:e.d o...\ :._ an tr
enc\ u:J,.....,~e. .c-~
i - - - - - - ~~
-uJ Sto ck _. .__ __
. ~-
__ __-_Jb.e ':)h) d:t. .ls. \ iO ~
0. _J_dci._ .o\-.:r11 IC\, 1,t) e 0-5 ti n£..d, 5'1 ?l ~0 Jo
~ ±be l I FD ~ i~\e I· e · \CJ$t 1(\
·,

~ ~o.._~....._~
-

'I C.iA-

)
2U '-tv lf-f

Of~ob.cY\s ~e...~J~,med en ~ta.c.\~ ·


\/ (~~h c \) e=)\ cd-, o h 3) 0 v eJ\ 51 ow w nJ; h "' n
l) Yofl ~pe..)l.o..hon ~~ 4) Uf\tle~y\ ow c_o flc1.1-h o r1

~~ ~lf uro ~ ft.lS~ (_ J ope..:no.hDn ·.


- - - - - - - 1 5te.,:i L :
Cne.d-=t whefue"' .$tp..c.. k \~ .ful \ Q.)"l Y\.Ot_·_
- - -- -4 -to\:> :: = ~ ~----
- - - Ste p ? · T1 StocR is -..161 Lt I ilie n ~ .e.h ll.o .n~ toe
ove:n~os .u o.nct exl-

St<:LCR [ to :)

Tf hop ::. :.. e'.)£)¼_ - ~ - - - - - -


-- - - - - - --1
5-tep 2 :.__ Tf me s\:ru-k ,·:, em ~
4 ±be 11nde4Q.LO__ _an_J - ~-l> J.>- l~ZJ .L.ld .Jju_
.___ _ _ _
--t
5t~ o3 · - lr St ~ l5- n.o:t-_ ~~
-then ~l i\I : The- el ~· c
>
o1 -&~ top Qf\d <leO\.UY\WC the. fu\:2 .
e\e-ment ~ sl-o..ck Ctc\~J
mp :: +cp - \

L - - - - - -__ _:i, ,,,,i ~~~ t) ~


L- -- -- -- -,, -.- -~ fui! :l ~::nv d:ie&J l,µe.. 'nw.1e \e.CJ..nv) ed l~te.. ~t.: nuc . h.(J.'\e
L - - - ~LU .U -" ~~ ~-
·n of ~Jc.L.Ck
+ Onh~ C Comp1" onl~ t'Oftot x

■ onlrnpgdb.rom

[i) Rr•d1nq 11\ 1

int , tac k_ lnc [>IIIX_LHC);


int top_lnc

void push lnc(int itpa Inc);


int pop Inc();
int pt•c,k __ Int();
int i,Lmpty_ln, ();
int isfull _lnc();
void display_ lnc();

int w,in()

int choice- lnc, itea lnc;


( )

( );
( );
(
(
( );
(
( , choice_lnc);
(choice_ Inc)

■ P Type here to search 0


"
+ Or.11~ C Compl!-r - onl~ t'Oftot x

■ onlrnt"gdb.rom

¥ouTu~ )\I ~ G ~ l"J T,.,.,,Latr •i tr.arm Ci) Whah.lpp [i) Rr•d•nq t,,t

1it ...
~ Inc
nc pop Inc();
nc
( ' ". . , it~
·, it lnc};

());
, p...,k_lnc());

1~ 6
■ P Type here 10 search 0 " §i I - ~
" dO) ENG 02· 12· 2021 ~ )
:-,
+ Or.11~ C Comp1" onl~t"drtot x + X

f- C • onlrnpgdb.rom
*
App, Gm.alll VouTu~ )\ .._ Q ....... ., r,.,.,,Latr •i ,,...., Cl) wi..,,....., rn Rr•d•nq t,,1

l!l ueDU!) • !!!!!!!>


0 mainc

(i,full_lnc())

( );

top_ lnc top_ lnc


,tack_lnc[top_lnc) ite• lnc;

int pop_ Inc()

int i te111_ lnc;


(isEapty _lnc())

);
);

i tesi Inc stack_ Inc( top_ Inc);


top_ lnc
itea_Inc;

int prrk _ Inc ()

(i sE11pty _lnc ())

( );

. ..,u: ~

■ P Type here 10 search 0 ::..


"
+ Onlt~ C Comp1" - onl~ t"drtor x

■ onlrnNJdb.rom

[]) Rr•d1ng t,,1

,tJck_lnc[top_lnc];
nc[top_lnc ];

int i sfapty _Inc()

( top_lnc

int i,fulllnc()

(top _lnc HI\X_ l NC

void di,p!Jy_lnc OI

int i ~ lnc;
( i sfapty _ Inc())

• P Type here Lo search 0


" kl
(ti ii 6 W If. tlO)
1~6
ENG 02· 12· 2021 ~ )
+ Or.11~ C Comp1" onl~ t'Oftct x

■ onlint"gdb.com

VouTu~ )\ ~ G Pw-w-. tJ T,.,.,,Latr •i tr~ C!) Whah.App [l) Rr•d1nq t,,t

(lop_ l nc

int isfull _lnc()

(top I nc MAX IPIC

void di,pluy _ lnc()

int i . lnc;
(i,F ■pty _ lnc())

( i_ln<
(
);

■ P Type here 10 search 0


"
P Type here Lo search 02·12·2021
+ Onlt"" C Comp~ - onl~ t'Oftot x

■ onhnrgdb.rom

Gm.all • VouTu~ " ~ Q ~ l"J T,.m1.atr •i tr.arm d) WhahApp []) Rr•d1ni:1 l,~t

rn • r~ I t.

~· l l ' r:

~ • I u :,t.

'· . .,,i:•

r ll' r: '/ 'l: f,

: . l u.:,L
•. . : 1
.:, ...... -~·, ,~.... ·- ~ -... ~--,.•
.... l "'i •"I'/ '1. :-, • , I. ,. • ,.:-,.

P Type here 10 search oz. 12. 2021


P Type here Lo search 02·12·2021
+ Onlt~ C Compl!-r on,~ t"drtot x

■ onlrn.-gdb.rom

(jJ Rr•d1ng 11\1

. I u-,t,
., r

P Type here Lo search 02· 12· 2021


P Type here Lo search
+ Onlt~ C Compl!-r on,~ t"drtot x

■ onlrn.-gdb.rom

P Type here Lo search W It. CIO) ENG 02·12·2021


LIZNACHARANIYA MENU DRIVEN STACK IMPLEMENTATION
(204041)

PUSH

6
5
4
3
2
1

6
POP

5
4
3
2
1
UZNACHARANIYA MENU DRIVEN STACK IMPLEMENTATION
(204041)

5 PEE K
4
3
2
1

IO
9
8
7 OVERFLOW


5
is Full()


I
2
1
LIZNA CHARANIYAMENU DRIVEN STACK IMPLEMENTATION
(204041)

UNDERFLOW

isEmpty()

-1 to p

You might also like