0% found this document useful (0 votes)
29 views

Data Structure Basic Notes

The document discusses different data structures like linked lists, stacks, queues. It explains single linked list, double linked list and circular linked list. It also discusses different types of expressions like arithmetic, relational, logical expressions with examples.

Uploaded by

ramesh2special
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Data Structure Basic Notes

The document discusses different data structures like linked lists, stacks, queues. It explains single linked list, double linked list and circular linked list. It also discusses different types of expressions like arithmetic, relational, logical expressions with examples.

Uploaded by

ramesh2special
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Dta stute:

Sesyuent'ad and (nted Orgonist


lo Companisons of
S.N LPnke Sejuenad
Ovganizaton
Organization
Dota Sbred n Dota s stored in
Ifnean Segene
nodesttat e
nked togethol.
Each elenment is
ach node Cotoins
Stoved one aften
data and a potnten te oh.
to tte nert node
Alloas fov tat
Allovos tor tast
3/ Pnserttons ond deetion. traveso nd accegs.

Sionplea to fmplemet
4. Moye Camplex to
Prnplement.
Can be yed for
Can be cyed for Sructues ioyplenmeuty data
tmplementrg dada trees. Strutunes te aroys
lists ard
('lke Ifnked ound taces.
mermary (ess menory i
Regyusres veqjuired ag ho
for Pointers Potntens needed
Con be sed for dyranse Suttable for ttatie
dota structuney. doda Strutuey
Plexible in terms of Fixed-size and
Size and Strutne Stuctue.

Rando aceess is Random acces is


not po8Sible. pos;ble
potntes auy be pointiy Al elemet ae
to null in Cage ot stored n contiguay
broleen iacs. mermry
Poatexs in Colo ?', veayuired to

?s pochle
13: Obn haie mutiple only one bead
heud and tail pointong
Can bae Vanable lerqth .

Can be ged tor Pmplemeir . Cun be uyed for


more Conplex data trodusgy Smple cato
Sthrucue ike
eke qaphs. yvee and

Oth nea diogran, explain the corein a Stoces


a.Siogle tnked (tst ,b:dable taked t
C. Cioa nked Lst data Shue
tatedtst is rea
Sirgle lWaked ist ta Srgle not Stored?n continuous menery
och te elenent ane elemet is Cannected only to ts
lo cat ons and eachpsitens
next element g
eoft nodeg
g and
Pets.
each node CoNist of toopts:
*Tt consst
te nex de.
data and yetenence to tte (ist
pefnts to nul, rlicis the end ot
*The lat node effit, s yoy
* Insetions and
deleon ane
te
valativaly
pointens ty Pent ad) vemave elemetk
an

Vieno ot Sle linted ist: PoqYami


struetnode

int data;
Shut nae ret:
4800 8000
Dale linked lit
tA dole 1aked |ated lit
t is Speei Hen
to tte previouy
fach node Conte ns a poanten
node the nest nae of e (ned
list
* It aloas tor
S both -fondand bockoad traven
ch mates onent ke gertion o.nd delefbn
ot both
ends more eftident
Vieus otf Double inked lit
oo|head
Sthuct node
600

600 Roo
ft data;
Shud node * next,
sut nod e prev;

Civculan lnked (ist:


* Te civculan linked et alFked Rt hee all node
le connected t tom a Grde. In a Circulen nted
Gst, te fst node andthe lagt ode one Conne te
to each sthen oshich formg a circle.
NulL attte end
* Trsentions and eletons oNe sioni lon toa vequlan
IRnke d list but veaive Special hodlis tr
te lat hode to motntane Greudan
Shutne.
Cavclan tnked ist -
hoad
Styut node
3o
600

fnt data
Shut noe
*next,
lht is E presston ! Discugs tte types of Pxpvesion ih
an exoumple.
Comliralon of oferaors,
Expresuion An exprerion is a fomdamental uat
Vaia.Gpretons
xpveions ae a
(onshoats d Vanialley. porform Caloaon,
progvanming, g theyae cged to
of ond procace veslt.
male decitors, opevtovs.
Ex eslt >opevonds
Vanible to stove
te expreufionValue penfom Mathemat'lGolele
mutiplatioo
Athmeie ex pvegsons:- Ts Sltraction,
1. dition,
| e addit'on,
openctrs
and division.
h>
B:- #iue <stip. The vesHis:2
int mainc)$
fnt a- s, b= 3;
nt vet a t ,
YeHs: d yesJ);
ve
Pintt Yeyt
vetnn;
expretions Campane
Relatioral
Reattond Bxpvession:- flse)veslt
. boolean (true cor)
edueg ad vetun a incude eaaliy (==), îreyuoity
Comnon velatoral operts (1-)
qyeatentan(), les than (e),ete
- #cludecstdio:hs
int mainCS

asb;
iat ves t=
aqveaten thanb?d,yeslt)
Pintt 'Is
Yotun;
qreator thanb o| Fodse
nens Tre.
*whe 'o'mepretalce ond
lorjcas copreton Cornblne
loteol opevetors like
(?ke AND(R),
Lpuleon for moliry
one often yed
deisions and controltg
lkmple # nchdeestdio. h> output
Result:I / Tyue

înt ves wt (1<) (a9;


pitt('ResuH dl', vesult);
Vetnno,

4. Sig Concotenaton:- Con ConcateroteSgs


te'+*
operetor.
Pxample'-ttahuck cstdibh
t nclude <sthimh

Chan stri Csb]-"Hello', Stre]= "orld;


chan vesH [io0]:
Strcoy(resut,tri);
stvcat(veslt, stv);
pritt(orterate dgthigs,rest);
vetuno;
Output Cancaterte Sirg: Helo corld.
s. Conditor efresion- It allapu t rake decisio
expreas?on. They take te form of
Lsthin Oun expressfon.
condition? Velueit te: Vaueialse
bramplei- tnclude ctdio.hs

vetunO;
3
6.funtion Cxpeasions:
Con cal funtny ond
method
Call Can be
po

fnt dd (nta, iat b)}


yetn ath;
ralnc)
int numl -s um3;
frt Sum= add (num!,num);
Pritt( The Sem orf .d andy iszd
numl,num2,Sum
Yetnn0;

output The Sum of s and 3 is ;


cassity te Vaioug typey ot
Defne dota Stuture and
dta stuctunes ith neat agram? dota in
Dato Structune is a oay of orgoi
ond strig
accegsed effiienty
Computen So that t &an be accegsed y
te dta bit lso yecl
yed for Organ?zlrg
riog tte data
yehievig ond storig
eBlock digrom
Dat structune
Lnea
D:s DS

Static Tvee |qroph


Stock aked
Lst

cwtene eah eleet s


Canyuentdy Car) lineanly
net element.
attached to its prevtou
Quee,ced list.
Stack,
It is dassified t osDyramc.
oc
Vun

Considened as effiiet.
stack,:ted ligt
ole nt
Yevense placed
l
onyartely
elemets t e
Tree and qroph
Arays
Collecon of Hems toved at Contsoug merorg
*htiple temg of Sane
lotig.
The ftrst elemeut
neanchig Sorfr by Subsuipto.
Possible. ravenig tind of qpect
3
12243%

ane nst Stored ot Catiguouy remory ostin.


The elemet Pa Gaked t ne liated pinten.
Hesd
A
Data NOxt
StactiLIfO
(ist one added to Stact cotll be te fivt one
be removed

efst in ftrst ot (FIfo).


Aoat LRean
Coaletta) t||34136] (Incerton)
Hedic s Te Ds t t ay fxed memory size and
Ex- Array
yee
ted to vepyej eut ond orgonizo
Hienanchical stucdune and Seanoh
eacty to raw'yato
that is
Colletion of nodey ttat aNe Conre ded edes
av,e) whee V(a) set of Ventieg
Cvephi Ordered set
conngt
(hich ane yed to
tte Vertices)
noteton and vevense
Ditinguish beteen Dolis h
polsh notat'on example.
wtth
ane tu00 diffenent
of wriin
Polgh notetion elininate te need
of porenty
mathematfcal expreesions to
and clanity te brden oft
Dpentior.
PNtte qperator Pre ceds
1 polich Nottion (P)
ovitten fa the torm of
te operands. An expression s
openato operand opevona"
Exouple:- Tretik expveon;3+4
polish otetion-34.
RPN,te pentor
Notetin ReN)- In
Revese Poliçh is coritten inte
perands. Ao expregsion
An
tollouos its
form ot oferanl openend
operatur
Eromple - Ioftx expresion:Notat
Notation: 34+
11

Revense p l:sh
Exople:- Sevegsion=+3*u"
both notatios, .
Tn polish Noteion:
Crginad ExprestioniQ+3*s"
PN vepregenttion:-+*34

1+"’ Opevont i:
J.*"p
erentl:3,opencnd2:4
resutt is Qt12=4.
is , So ttnat
3. The vesdt of
0*rd epreilion")+3"u
KPN aepreterntadtn:" 3u*+"
1. Dperondl:

operords:3
3- operatr

operandl:
operator:4
regult ot'+" (1+1)?s 4.
Exlatt- the tortept
Whot is steack and bbasc openatton
gpettn thherample
AGHact is o lBnean dat îhhich he
trute
Dfone elemet and emovad af ins ention
an existig lenet
totes place ot te Some end
ot tte Steck. vepvejerted a te top
LIfO Clogt n Pirt out)
is Strategy Stoteg that tte elemetthat s sertd
lagt l Come int. ou tan take a ple of
kept ontop of each otes ong o plates
Te plate csbich e Put layt s onte veal-fe exanfle
Sinee ue
tbp an
vejve HaPlate that Ps o tte top,
Soy thet e plate hat a pt
pit lagt
lat Come
ot fvst. Puthitem
Ph Pop pop te
Bate openal'og on stack
Rae
in a Gtaet,thene ane
make maniodato
Ta order to
to u
(etoin operatiors pr ovi ded ircto the stack
to elemet
* puyhl)i- faseat n
from the tact
an
on elemet
y DoP C)-to remove
elemet of the Steact
top)- Retn the to empty elefolge.
* t stack is Yeurtakel 7
0:- yetans te
* sfmhy orf ta ck.
si2e
Sze):- Vetuns te
Tof-o
S4akefo]-!
Tof -l

eytyset

You might also like