Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
49 views8 pages

Dsa Exam 2

Uploaded by

Sagar veerala
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)
49 views8 pages

Dsa Exam 2

Uploaded by

Sagar veerala
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/ 8

V.

Bagpn
RA2D10 T[O20100

Stack
he
Structure t Stores
Stauk 1s elata
0Her
0Tdered manney
demens tn
ft meahs
Lost tn
Stauk called Fo
fsst FILO means fs
C a n i Oda hemove

n a Stack W

hom enty Enda)rv2 T92


dument

ray mplementaton
ho Shek callud
top mast umunt
Thi To
he au 2
he

TOP wuLL ae 0
Stack emPt
emPty
This tuus hat he o2JOge

TOP- MAx- JUng4T


tull
hatyhe Stack t s 23
This Huls
and demns tiS, 3318 34
Stack wtth sge

b
012 3 4S
nos
T0P - 3
here topmustclemenre

becaus 34 h

PustH opoiatfon
The pust opoatfon suscol insorttng
hru fkement tnto Stock
TOP becau se ftts
hare he ne dlement

the topmast element

TOp6
Akgeifthon ft th PusH penatfen

Sp Top MAX-,tha
PRINT e vER FLew

SRe SET TDP TOp +1 1


Steps SET STACK CTOP) ALDE

Step END
s
PoRsatfon
The POp operatton ts usd fo deleti ng n
dement hom Stack
The PoP DPexaito TUme vu only he topmat
clement topm Stack

F TOP=NULL AM
Ths tuls he Stauks tmpty Curd 0
deluter Ca
bedon
ToP MAN-
TnIS he Stack ts ull anddeetlen
Can be done

ToP =
PNgohlth PoP opraten: Saqa
100
hen
TOp= NULL WT3 anlh2/ou
steP PRINT UNDEe fLO
Ero to Step 4 awp.oP LP3 o
Step2 seT VAL= St ACk CTo
step 9 u S er ToP-TDPiuo
SRPu END
PEEKk OPHatfn g Jaull
tspbCess th uontch&OulHe
Pek Opera.fom
nselamentthu Value of demen wth out deletrg
Eom he Stack aLak á
alw ts Setuned
TP TBP NULL Hho

well reuww 23
Thio PEek opeyatten
top m o s lumui
1+ 1 HAL
Becouse
n) otrutltfrott
petk Operauton:
Atgotthm fa
J rT do air 9te
StRPL TB TOPNULe4het
PRINT stACK 6 EMPTY 9T2D
yave a K l S T S95

CEND O uA i0
Szepa:
RETURN srACkTOP Ta1 7has T3
Sep3: END

ts a data Stwchune tt Stones th


elements t tn a ddud manee 1An

s FIPo mcans
FO1s
Oul
T maans h umunt ushssk 1 enscosd
Can
b dslsk n t
Th Jumans quu ouoddsd
one nd d
fs Colld 0 lgnd
mdProm oha d.1solisd et

PRoWTrtoy 2
b EnquuuL L4 3 11,29

glHhn Ho Ingevt on disnss


Stup 1: Abtak
ttas PTR
erp2: Ste PTRDATA =voL

Srep 3 Tf PRDAR ULLthe


SET FRNNT >NEXT REAR EKTE NIL
9ET RER A T E PTR
SET REAR PTR

sittMe2 TREARINEK eniL 7

2//
sct END
Sanp
c) 0caQudu

ument tnKad ou
deluta

TF FRONT = NULLHHL
SP:
wstte undePtow
Go to &P s

LEND Ft)
SET PTR FRoNTU sce u
PRONT RONTSnExt

FREE PIR
StRP

SeP S END ab
Sparse Maht
Cortatns moerumky
fmahf whtch
NDA- ZEmr d
of 2e10eS ha
Hho SParse Matstg
aS ana
sparst t epE gentd 2 atmenspna

Lst of mem bay 1s OaSrzd

o 0 3

Het the a DnDT 2eS hon


a
Apr-20165 2
Sooa
Da
Daus tsDube edad Qeu fn h
Deaus dsmeats Con btnsestd
dulatd at efthoznd
Con fmplksnestd Ctrcula
auag

tpes.
OTip Resttdtd a
Output Restrthad Ocau
2
Tnput Reateed au
Inpt Resttchd Daut h n Strftec n
dsre fr C nd and daltbn o n be
dgn fn th
tu ds
ulpur Rs-HCHd Dapa
outpu oukpu Susctd Dauduuta
den fn ofL end and tnseyHen a

erds

tpataron
Bosed Ptelr umbesS
ae insero

Batety Gumn oc Sdtn


Sagat
100
6phatng Spems

Onal 2d
itoiy. o num.bers
QuLs au Uscd tn Playtt st Por rohe box
4
5) 6ULuLS QUL used as buffes on ps playes

A
DCnla tnhed Lst
datagtrutu
Cbrcula nHed 1ts
(n swhto4
Ponts Hh

Atrst node SiporstLN on


3AH99

eilojnstop

Abp2tthm:
StroL: TP AVfL NUL
wtte o VER FLON
0 to Step1 END orre
Step SET New Ne AVA
Stepb SET AVAL AUAIL-NExT
StepLy SET NuD NodeOATA=VA)
Shep5 SeET PTR= START
Stepb Repeat Step 1 whtle PrR Nex T=SART
PrR- PrR NEXT
Skpt
Stp 8 SET PrR NExT TA RT
SteP eSeT PrR-NExTNEW Node
Step b: SET
STARTNe Ned e
Skep 1: 6xIT

Languoge Suth as BASIC & foTeA N

wdd not Suppt th potrters T


LnKed Ists egulreod Pofntors a
an frmplemetato
avatbe ter an
must be ed he OJtcinodde mutnp
wul destt be S knouwn as

Cunstl fmlementadion

sJtar

shri

You might also like