0% found this document useful (0 votes)
6 views7 pages

Dsa Paper

Dsa paper

Uploaded by

Chandramouli
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)
6 views7 pages

Dsa Paper

Dsa paper

Uploaded by

Chandramouli
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/ 7

Nos.

ata Strue tune s aa logR cat /mnathetna 19cat modet


Parteubar organsatfon od data. lota

Pntt* ve nonpRtve
.|49 a Wincl o olata " non PRive dat a
6tretu re that tore Shrecture Ps a type of
data struture thof Car
the ol at a of on'y Store dote of morc thern netyp
one type
- Size Os not
. 51ze depends
type ot da ta Structure
" eLis tstates, troes
E: nt choroat

Lb. nele cstel to->

9nt arayLoJ
nt ?, low, id, h?gh, Key size;
PRnf C" Enterthe síze of onarray ln)i

Pint{(" Enter, the


for Ci= 03 9<size 39+ +)

Sean4('/A", 4ara yCiJ);

Print C" Enter the ey ln'3


Scont(" -/.d key);
Low O

5
Nos.

4Chey== artay Cntd3)

returnj

14 Chey c array Chmtd])

Clse

L Priot{" unsutcessu Seore hln)s

Ja.Defe Cncor array and shouw the ineor rrey epresentahior

hray 9s an orole red L?s+ of elernents be longna fo

Srilor dataypcs -

memor epresenta#fo oLln ear orey'

let 9nt maruaCsJ ',2,33, 4y ss be arrey:

9s epre sented Pn memony as oltows


loo4

har us 99 33 SS
maruslLJ marsCiJ moks) morksC3] merles[y

lenent 95 Stored 9 mares Co]


last eLernenk 9s stored n

Observe that 90 an aTra y the elernènts ai e Stored n


Locatforn.
Conttguous memorg
6
Nos.

3b-Develop a C progro n to dernonstrate 4he arra y epera Pon s


oscrt, delete and dlsploy operaHons.
netude <stclo hs
Hdeie MAx_SI2E Ioo
pos, 9o velue )
iot osert Elernernt C?nt arr C3, fot size, 9nt

I4 (size >= HAx. sI2 E3|1 Pos <o|| Pos > sfrc)
arrC?aI3 arrCi33

arrCPosJ : volue
Tetur osize4?

4nt de le te Elerment (int orC3,9+ sine, nt pos)


4 (size col| Posco |I pos= Size)
Yeturn

for Cint9- pos <sine -ts a4)


arr Ci]: ar C i 3 s i

retro si2e - l

vofd disp lay Array(?nt arC]-9ot size)


Pint4 (h Arroy lernents. ")3
for (tnt 7cos ?< Size ', 14+)

Prot4("n"j;

int matnl)
nt arCmex.sne];
Nos.

sie- nsert Elernent (a,Stie, o, sD


Stne nsert Elernent (ar, Size, o)
Size = oscrt Elorment (an, Si e,7 J;

display Array Car, Sine 3;


Siie - deteletleenent Corr, Size, J
d'splay Array (er, Sire);

3a.Deffne Potnters and devclop a c progror tosdd kwo ombs


usBng ponies.
rnter 15 a voroble thot SHore s addrcss f nothc r
UoRable
+nclude <stdlo-hs
Vo? d mainc)

Tnt numl= umdr3 S u m o : n i

Pinl" Sum d"5um)y

Outputi

3b Dev lop Cprog rom to displey he address ond dota eloenls


potnkers.
?nclude <stdio.hS

nt arrCcJ:(1o, Jo 30, 4o, Soyi


8
Nos.
iodPh rr
Înt n size (or) /size of Can Co;
In *):
Prin{("Address and dota of arroy elernents
tor CPnt ?-o3 icn3t)
Pidota din ?
THot{" element hd; AddresS

4a.Dene Structures and develo acProqron to darnonsot


arrey of 6treeturcs.
1elat ed data ens, of
Structu re 9s a colleetfon of
stngle Sme
5t-lo | d 44erent ata types, hang
4?octude csBalohs
tteletine SizE Jo
Struct student

o4 roll_oo
Cher nemne C 2 0 ; o

Stuct Shdeot 6td CstzEJS


ot no_6td,73
Priot4(" Enter not Students |n

Prin{(enter the detals 9e oll no, ncme 4 sem )n)*


tor Ci =0; i<no.std i 44)

pio(" Aor t he ehdent No-dln', ?+i:


Q
Nos.

5Can C" d5/ 4stdC.Tol:no S4d CiJ- neme


4s1d JsemJ3

PRnt(" Lo the detatls ne Inln)


Prtnt4(" Rollno1t neme lt seriln"J3

PRn{("o%d)4 . stdln" std CiJ.9o1Lno Std Cil-nene,


StdJ"se nJ

Hb. Develop th an ppreprfal e 6trtkore


a
progrom
definie ion and Vooble deetora tfon to store întorrnaon
about Gn employce s Sng nest ed Shructores. Consder the
tollons telds Enemnt, Emp?d, DoB (Day, month, yeor)
and Salory ( Bestc,DA, HRAJ
#nctude < Stllo S
Strue t Date Bith
nt day 3
tnt nonth

Struct Saloryl
tot bas?c;

float hras

Stuet Ernn loyee l


Chor oene C s o ] ; h h
Int ernpld
Stru ct Dateo{Bir t h dob;
Shruct So lo soloo
10
Nos.

int matnt
Struet Employee enmp
PrPonEntcr Cployee ne me:") 3

Ston4 (' Vs", emp-neme))


Delntj (" Enter Employee ID:"33
Qton4("/d', Lemp. emp d)
month yerd);
Prin4( ender Dote of bicth Cday
yeor]
Sca n (" dd' empdobdays 4empdob-month, 4empad ob
PRotc" ender bosi c Salony"')
besic);h
St on4 (" .4,4 emp.Solorg.
PrinHc" Enter De orness
Stant(/4{, ernp Salory da;

Sten 1("/4, demp. Salog hra)3


Print Employce detals]nU
Print(" Nome Ys lo' emp:nome
Priot4C" D:/.dh", cmpP-emptdJ;
ld-.o.4ln
Piot(date ot B'r th: %0ad-.o
e mpdob.doy emp.dob:monthcmp dob-ye o1)'
Pin("Bosic Salory:2{In', empsoleybosicJ;
Print|( Deorness Allaonc CDA: 24 ln',empselog" de);
PinHv House Rent All ente ! y24 In', emp. Seley. hees

Sa. Expl efo the dynoric memony a llotaion tunetions A? th


etornples
Process o alloca Hng and dealloca Hng clui
the oecuton ot the pro rom is (atted Dynate mmoy
atloca hon

11

You might also like