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

Dsa Assignment

1. The document appears to describe data structures and algorithms. 2. It includes steps for inserting a node into a linked list and removing a node from a linked list. 3. It also includes steps for adding a component to a train and removing a component from a train.

Uploaded by

sk3430
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 views14 pages

Dsa Assignment

1. The document appears to describe data structures and algorithms. 2. It includes steps for inserting a node into a linked list and removing a node from a linked list. 3. It also includes steps for adding a component to a train and removing a component from a train.

Uploaded by

sk3430
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/ 14

Data Sfuctune hd iaot

sgorut
Topien
SET A PART-C
SET B PART-C

Kund
RAZ2I1O56010|17
AF-2
all for
bead
of wgn findB b)
15
inequttey.
inegkey. beh above
ane
ni
3
3.
2+| 34
no nall
ho
3
bend lawen nd
FiK
5
c PART-
A
Set
3n+ 2 LL 3n+2n,

o 3n +2 L 5n
C2 5 ond

|6. Wrik a C
progran is b
te Sum num hy
dynaie memy allom.
Somye Inptelanet :5
23, 34 |2 34 54

#inelude < st d'o .h)


int main C)

i t Count

int Sum

);

(int ) maloe (Cont* S of( tnt


));
(iz 0, i Ceunl

de elonat d'; (ju),

(am);

Btu elt 2: 2
fka elt 3: 3
Cuta elemut 4: 4
5: 4

Sun is : 14
collge
items ae

mene

to inelde a huo tem hame

oik is ual nepreseAmitn,

Vo d dadk Cint e yin Zist L)

pesk P, itn Pi
Pz p’ Next;

P P’ het
-z2 NOLL)
p’ Prer’ Notz NULL3;

veid Jaetint Gay intJ;


pes: Hon Necsode'
Nes wde Cstruet Nole *) mallae (r2a op(Shuct Nole
(Neu nade zz NUL
Neudno
(p Net lhNULL)
P P nent;
Nad node ’ PrevP
lmer) (*Fahl print
), NoC'd tnet of
(tre malloe Node (Struct node Nes
Newnode tion po
p)
pontfon intL, ,(int inet Void
L;
rehn
zNULL; Net L
elej
m
Z:L'ist
behven. pantmut
in Com
l, Struchie a
duhSomglemnhtn Cud
sa virhl conntmut.
a Re
b/u (orjin
Rwithdehchet aHacheta beCan pantth Com
lw inbne One
hm
fngine g ninhelly
hao foprern Bhat Vande 18.
hedn a s
ele

New hode

Now nde ’ Net zp


Nest;
p’ Net hodej
PART- C
15. (em:den a ooda train wheh initaly ha

handn. Lan Compantmnh


in sani. Jh Compatms Can he otoacdit on dehekud we

A
Step ! IF AVAIL z NULL
wre
ho to Slap 12

Step 2: SET AVAIL


stap 3: SET AVAIL 2 AVAIL NE*T
Step 4: SET DATA 2= VAL
Shp
Slep 5: SET PTR 2 S TART
Slep G: SEI PREPTR z PTR
Slap 7: Reput slap 8
and 9
Slep &:8: SET PREPTR z PTR wlel z NULL
Cleo 9' SET PTR z PTR
NEXT
[END OP L0op1
t0: PRePTR NEXT
Step SET NEWODE NExTz PTR
Slep |2: ExIT
(i) Debchny a
Compont munt
Steo l: IP START NULL
Wrie UNDERPLOw
(no to Slup I

Slap 2: SeTI PTR z START


Slep 3: SET PREPTR 2 Pre
PT R
PRE PTR DATA! z NUM
Shp 4: Rept Shp 5 at
at G G wle
Shp 5: SET PREPTR 2 PTR
Slyp 6! SET PTR z NENT PrR

[END
Shp 7: SET TÊMP 2 PTR
Slp 8 SET PREPTR NENT z PTR: NE*T
Slep 3: PREE TEMP
Shp l0: BXIT
Snce,
all
cae | znoont 2 O,ehoe Cae,
Cn we Ks I
toheed
in
foz) ho>3, Chose Can e ) vo.appronch
2
As
h
02t
n'son(Since sidnby bofl
no n
6gCu)e 3n
2h3+
3
Rt, Such hoandC,0 Contaty nd oned We
(n') {(n)on )
on beund High 1a
Find
Cubic a
I6.
ht
2ndain;iinat litiz
n; Kor
i2
3; zZnde int int
delete iz Cint for
22; Index dalek it
7,30}; 65, 51, 44, 32, d22, [l: data t
)4main tnt
piebal a
to Cod prendo
prile
imut towant you Rat afa and Kin deleled beheed L4
eleh Locatms.
The memy ad. in Slowd ae hch 1.80
32,44,51,
65, 22,elemat the itetuehe dah (eoaa
tprekn
ft. vll a
eond to
One
lleß,
e Zle A,
(l am les adl6ed chy
prieHe band
ik on
to Dovid 18
80, 7I 65 51 2 9 32 22 D
92; gmsut
aen and 44
80 5 6 5| 44 32 22 Dah!
xchan
O;
iln;it) (intiz
0) for
Sup:-: AVAIL 2 NULL
AVAIL

(ao to Slap J.
END OF Zf]
AVAZI
ub SE T NEW-NODE z
Step3: CET AVAIL 2 AVAIL ’ NE*T
Ce7 NE W- NOD B ’ DATA z VAL
(lo 5:SE7 NEW_ NODE ’ NET2 START
6: SE NE W-NODR NEX7 z START

CrT
STAR T PRE V2 NEW_NODg
Cleo &! SET START 2 NeW-NODe
Sl4p 9: ExIT
Delehsn a the End
NULL
Step 1: ZP START 2
ho to Step 7
END OP ZP]
Slp 2.: SgT PTR START -

S4p 3: Rent Bup4 hile IR ’ NE* TI z NULL


Shp 4: SET PTR 2 PTR ’ NExT
BND OP LooP 7
Skp 5: SET PTR ’ PREV ’ NT z NULL
FREE PTR
EXIT,

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