008 LinkedList (II)
008 LinkedList (II)
Page No.
1. Mid Paunt O LL
we Com eaily dound bOSing
length (otennem vin2
2 But the bes opprDach wull be
Slad amd Sopt painten
e tümSloo
modo 1 mode 2 lo th mt u u
Me mUm L MONFE m
CL
ncdel AA
AFten hot Check lao+n
nod 02 indiuidwon
Rmpty thon
iE Omyonais
fhe
dipecHu PUsh He
i n the m
ellments
nal node
3. Sornt
.ASt md +he mid
O&LL
Omd paiton the Linto
wo pant
T7
And Hen th pontom applu
mengtwe Sopted hked i s t
Algomthm
Reretse
byvsn9Reuunsion-
Dal
Page No.
th hend moda
tha end
Aften ne CutSive
Col, Iteret a
peuntn amd Polnt to 1e end
aften thor nSeE H ho nd
hend MexE » b L ,
Best CpHmadAoouaCh'-
Use paie NhLls gtones
oot head Gnd 4al mode
SU way om elae
Optimi2e ow Cbdle
6.RevcS LL Thenotive
NOLL
QUC am s to oeveas e the
ROy into oRp08ite dideCHom
SONemeed (Poev Cunn,mex) node
CUU mill Paun to hext
Pney mll Peint t Pre o CLun
n u l l PCUn to mext for StorDe
proew
C
meXF= PrPV
Ppe=e
C
6.Find amodo m Unked i s t
Recu Sive)
Bo e Cexse Cetunn -1)
Recwt8ive ape.
i 6(h2ad >dul-a n)
iComs
Petoron om
RAse
hewm omdt
Evem_Afte dd nk@d i s t .
TTE
mot e quNU +ype 2Node *
WO
L)
LL cmd Tmsenb Ol ug
ebuaat meid LL. evem
m enten add.
SO Tn 4hs tWO
we Com hondle tis)
Delete Evey N Nodes asten eNy M
NodeS
Just heep CoUnten amd do c
bu t h e e hwd to ep ccovoding: _
ouoe mmy Coa nen
, 1 Saap two_blockb
USin indloy
7
P1 C4 P2 C
3casoTTJ=cO
e
p C2 P TATE-JI=)
1)else
P1herk C2
hemoM
P2mex=Cl
C1m ex t-C29next
C2mext=P2
7 Date
Page No.
10 -Rewns e in LL
T m o o
Cenefull decwSi0).
W Can hul VSe
7 S^ NOLL,
P A s e T o o s e a
2 3 u S NULL
RENese
pocunsiom
21 nec
S-
2-
/c >mex=t3NeX
ex =
for (i0 to n)
twhe aNULL)
eSe
MOnaM
meom