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

0% found this document useful (0 votes)
56 views103 pages

Data Structures!

Uploaded by

ptrial1900
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)
56 views103 pages

Data Structures!

Uploaded by

ptrial1900
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/ 103

<br>

Dato. Stucthes
Data stuctune- Matthematical and model itehhelated doto

predelined Seperatieni Haat


stuctun e orgaiging
data.
Data stutue

Linear Nov Linear


Elewets a
tlewvt
in nen inas taslion.
fashisn
Ayrays
Linked Lists Talole
H
Has
Que
stack

Claseigcation of bot a Structun

Containe
to store ter dota stt et elemerts hare ainewt
data paionities.
for iearcling
Quee
seauch tree
inded ist
HAVL Tree
Hasa Tole
H

HB Tre
H
gt Tree

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Syllabus
L'AYray
2. Linked List.
3- Queue

5. Tree

Best seloctien so
Data ttat
wput, utut
and wtermRdut veute
vsrfik ,Structure can bu cceed geuenated
minimw
ubiliytio)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Oþeroti Data stuctes


Traversing vistig each eleet otteast onee ueel

2. Inseiem ;- adding
a
element u
data stuetne
beLetien - vemovmg eleet tron a
datoa
stutue
3. a
Seaneligi fnding elwt w a
data styuctwe
5 Sonting aoangg elenenta
de
6 bivg 2
data stctung sae type
Overflewi
Hhen tuten, wtieve possible.
This endity u
called oerlow

d to

Underei
Owpy an, wo
deltinisa posble
This Ceuditen is called ndenew9n

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Rtiziv 2r9vNT
ALaoithim )

Stepi by stip Sewti toragonithmic praleleMs2 .A

tor Samne problem.


To covmpane wmuttiple atgonitie

measre spatoU
to

2
Ru Time complezty
measwhe,
putht
by te alaoHim

ey routl
Rate
Measwe hate at wth tu unte
w

ereajel wdh ncnemet the

Exanple
T(n) : nt2 nea

T(*): 5 quadriatic

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

ascendg Ordey
Complexites in NOl ofywye
of gouth Complexdy
Rate

Constat
w
log
Logani thuc

Linea
wlogn
Loganitawie ininea
&uadhiatie

uibielma
Enponeutial 2

Factorial 2parowsq

for (tzl; i<n i: i*2)


K= mt2;

)
for( i'e n ; ibl; i:
Mt2j

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

A
symptotic Notation

Big
Previdee tabtest uppe bond
worst complexty
D(R)

2. Omegoa 2
ower bond
provides tyht est
best case Cdea)

-
3. Thta
pravi daa averag bond

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

o
Colleckie elenets
stored en locatin
Al eleet can
AU
elets e'wdies.

Dežinimg Longuag

<data type> <name>[<özes]

Ex:- wt
ddnes aay Bae addreu (B)

udex Lower Beund) Lg


Stantg ) Ug =
size -l
Lost mdex ( Upper Bend

Stuctu
Defining
De oay in Data
depuet ay oreypecti t
qeuenal atotim to
I+8-Jj :2NA

name
Exi A[2:15] Ls:18]
8
, , 2:6], »[-1s

|Size ot aay
s

O Detautt Louwer Beund


(4 st gin gus)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Locatien t lse)lo)
at Locatitu(AC1) Base t
elwnt W*TAB

Thavensimq in Aney-<r's
othh Nisiti Runtime
Allj Complexiy

Spacs

Ques
o
Conside a O9hat A|8:16]· Totad nudoen ends?
Ans:

om locatin lo00 Eacth elment talees


-
elemet Als]
5

Locotien (AjS1)= B+|i- Le)*

B= \0D0

|D40
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

JL-5
Finding mi
mininmum eleet
=
meeded
No ot cowmpariens

min: A[8].
for (i:
Ltl, i<: Ugi t+)
fAL < min )
spoee,
L

Minimuw eleweut can aso be


Tournaet metuod |wtne adjocet deeute
a r pes
Tounawut.
Mettod: t

Ruutie

mori

Finding marinun elemet


Compuisene nadad :
No n

Max

Ruuvtime
>
4(A[] max)

Max Aj); Space


iowpleuity = l)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Finding wwnwum aud maimum wth mininu


Covpaione.

2(n-1)
meeded
method, is used
to be doue.pa )

waxi mum
posible seletien ca gne' miium
2 compaisne

MetHod
ists
2. and
O Ceny Create pavu et 2
Compa ayooo elnets and
et tee pain
w
it sial
RT small
tist lange

space Find mini un element 4rom b


snaa'
v) wanu etment
ut and.

Oþerotiau No
e compaie
Rrepa 2 uts

waimum

Total mo
3n -2
2

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

n iu odd, Lat elemt is copied


I compaod - 2.

Touhnament etandDivide
meto d bivide
and,tougen opproacla

eeded :
Rundine 9()

nd winiwm
nd wanem
Best atgon Ham to
o (n)

spaee ei)
MthodA

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Lineor seorch
t Linea-SeaelA], L8, U, tem)

Runtiwe o(n)

Netun L-lj

( bsth
Linear searc caun lbe
a
well wonted ).o

|Bin ohy seohchl


.
Cau be

iat Binay-Seane ( AJ, Ls, Ds, tun)

mid s (Louw t Ruvti


wile Louw<

mwd Low +

A\mia])4.
Low wiatl;

vewn midj
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

2D Athay
colectien e4

2D Arroy In c-Lagug
<datatype >
A\31L4]

cotno=0,1, 2,3

LBib
UB: 2 :3

2D arsy dedaratieu 3
2

Aoo A DI
As

Ao
A
A3
2|Az0 A21/AagAs
OBi-LBi tlt
()

2D Arroy storoage
2/9 222 21

1. Row mayor 204 or 216


den263 210 212 214
A A22 A3
200 202
Ao3
A o A
Ay|Ai3 Ao
Aoo Aoi Aoz
lst row.

mn major ordeucng
2. Ceu r.r.. 210 219
200 202
Al A21 Ao: A
A2AosAg A23
|Aoo Ao Az Ao

-Istice

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

A ddress calulatien in 2-D asy


1: Roue major orderi ng

Locatim (A
l
umn
Comn najo
or
dexing
Locatienl
a°lj]): 6+ w*j-La)*mi-ta)]

Lower

nonZero sthente, ()

o-
elennts tored
2

Ai Ar3 AA
A A

A3

3 4 5
A4 A2 A31A
A
Jos |Ar A3g
Ay Ay3 ryy

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

oeatien (At

Lucation (NIL)= *(t-)


2.

2 2

- (-j)»
(il
.
Total
2

(stumn moyor ordeYin

Az A31
32
200 202 206 22
29 220

No
elenet n
No

No

No

4
elt n=lji-]
n-j+2

Iotatb nets=
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Ttal moy ; elomutd i4om colt colunjt


n+ (n-) + (n- 2) + -
(n-j-2))

nlí-)- -j-2+)
nj-) -) (j-)

Locaten(aLJL) : B+ (j-)-j-2xXi:)
w*j)-ji)+ i-j
2.

Uppe Thiawguan

ZerD

No 2

An

AzA As A

Agt AA33
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Rouw
Rovo major or deing

: rO3 n2n

0wI, to
Totl
n-li-2)
n(i-) f-t 2+ ---..
- nli-) - (i-2)(t- 1)

2
JNo. eliets

Locatien (ALIJCy)= Bt w* nli-) -(-) i)


2

|teluan wajor ordig


=
elemets col2 2
No

=
cel (j-1) j-1
eleets row col to cel i4
hetore
Total no
e
elets
l+ 2+3+ --) 2

. Locahiem B+ w*jj-)2.
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
si-)
<br>

Prandorm acces et elst wg


staces,
then data stctue!ied nplewted lit
hees ete)
preseuted

covebad.
eleete he wodiad)
deelared, caunot

Iusentien amd deltim ae


stored
n ceyecctiro kcetig
Elemets wst
loe

eocatisn! wol awalable,


oy
men
Coeetive

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__21094
<br>

LINKED LTST
O
Linea data stu cwe
is maintained pauntun ( liuk)
Linear oYdey
odes.
O List cetae data
fields Elemint k.
Node cotae 22
nert

fist poivtn:
Linked List
NULL
struct node d petnter
3
NULL-S
ch data
struct node * link;
-; Rins2
Empey i'st Coditiem

i4( head= NULL)1.


Lst

Cenditi
Sngle No de
=: NULL)1
4l stat > inh
Nod
L+

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Thareraig
stauct
P: stat;
wbitelp]ew)
puint(p>dotay; CenpltoE

o
Finding oddne lat
stnict wode *p
Jiar p: start;
4stiettint Runte
Cowpluut

L
pnisninsh

alas lmear
"Seahing Akod tut.
Seanchig in tem)
,Secnelimg (stat,
styuct nod
p el
stat
.
wthie lpl= wl) Runt'ie
=
i4 (p-> data
Pi

rctwm N;

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

m
mhed Lst
In sertien
node *) malloc( siy of( stuctrnod)
struct node * n
w
>
Inserti
ndat: Ruustine
e4)
stat

Insertim agtr a gure

Insetie( stat, loc, tw)

n> data : ten; Ruutime

betore a grem mode


Insetin
M> data iteu;
* p stast; Ruuctiie
strut wode
Loc)
wtile lp> inkl=

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Deletion in nked ist 92

urte
strut wode

(I}9 treelp);s
mo de t

9)
stuet Rvd'e
stant =
stat iwk j
free (p;

mode,
Delctien olat
wode *p,= Stout)UDERFLOO vetun
stuct == NULL)
trtte itl stat JULt)
totite t p->tink

P P
Rus

tetw freely

ast ode lat ode


Deloten
stuct wode p
tat,
wile lp>ink l= last) Ruutme
P P-> nk;
Stnct uode *q Latj
4reelq)
NULL
P-> ik
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

a giem wodu ( loc)


Deletio

stuct node * P Stat;


p-> iukl= loc)
wlile ( Ruucne
o()
L
P

node

ine); Ruutme
free ( lot Cewplxty

a
'Deleten beee
wodi to
Strut linkl= loc)
wtailel p-> ind>
Rtme

P ink

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Lneed lwt

O To stoe polymomial

)Univaniate polyomial
vanialole

Coe Expoat
Node :

Stant

) Bivaiscte polyowal.
2 vaniable polyo wusl.
+7x+ay -=0

Node

Stant

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
st
<br>

Disadvatoges o sSungy inhed


ode š wst
Link pat lat
The addes8s predecsnor wot
huen
poscible.
backwnd is,mott

Header List
wode called eeadeimod
©
headen wode contaus aumnmay iyoAMatm.
wode vstored boz tor wost
(
amd
and calubatg
tales (u) tii wntine

Not
5
Heade
stat) node- rJ}
head

Headen wat
Trarersi
rrcutan
Gyounde d

stuct node *p ist inhq


NULL) wte l pl: ist)
wile lpl=
Process p> dataj
P p->

9(n)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

gobaowlnsit
Linked it
Doubuy Linked List
.

Data
prev. next

stut dnode YSDOSH

to, Stnct dnode, *wextjnt


bo Stuct duode pvev,

Last
lat. (Last poutn is
waintawnd or
loackuwnd
fhai

Insetie at
struct dnode *p= stuct mode
mallocliyet (shut noda) );

P> data: cHen;

p> prev = NDLL Rutie


P> ect head
keadts
hed
hed P

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

guren wode
Insetion tn a

shuct dnode
P-> data
*p
itewj
tt dnodai) matloc(siye stuat diod).

Loc) Rutn
-
Loc-> net
pnext prev = Pi

Imeabew belore a
gien nod
ada

P-> data;

P-> prev Locpev; Rnte el)

at t end (art wode wot

(stntfote));
stuct drode * (stuct dodi*) mallo(sheot

-> naxt : NULLi

Ceplewy
lrtilel p> wext l=
NULL)

P: pneut;

n-> prev=P;

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Deletion trom steutig


head
*p=
strt duo
)
head head net)
head pren = NULL;

free (p);

e a
Deleten
e Runtne
loc -
preN;
oc ext prev =

be
>prev next
treel loe)
(1
at tee end
Last mode
Deletio heady
stret duo de *pz

Ruute
Cownpinty

pr
pretink
NULLj
next

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

QUEUE
OA
near data stuctue wlicl
w
wetien can be

eud (eas end) and deletio is doe


stlhen wd (font eud).

o FIFO( Firs. In First Out) st


Ins etien Enquee
Deltim?
Queue au
ied
st

Linea qe
(Yeor: N-1) Overte (vont
4
o22 reanz
(uditen

4(4rantrnas)
Condulu

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Applicotiens ef qe
hoguets swngle shaned resrce he
O Sewing
CPU tash selhadig
dusk sehedl
b{w 2

IO, et.
paceses
to hold people.

Arst Search (Bps)


Badth

Pogowed
Double Ended Queue
seutien deletieu
Que wlieh
tom loeth ends.

Restricted Input is hestictd to


PTput Deble Endad tee stendand end (Reasen)

<Deletion
Gutput Resticted Qutput hestuitd t
eu
Deuble Ended standand ud | Aont
fee
Qusue

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Paionity Queue prionity attached and


A

Evey elemeut eted uith


while delatie. eleet eltd

Quene

Paioty5 3

Phionity queue i Implentitiemn

Hauale Randle Priouty ot


Yhonone
ct nstien deletien tie

bInsetn - n
uch
a
Inietieng
Iyet eleret Iwed element ot
taat elewents ae 0)
srden
-eas
to rean. belatien
Find tee eleent
Deleon 9(n) wtth
Delct tee ud datte it.
90)
elenend)

to
mplement stack
stack and

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

tastnway su
Elemnets be acceed
piontg)
Oadd
caw be iwpleentd
(oijaba alyoaln).
elmut)
wsed real tie systwe
vetreies'igest pionity elt
(bcoz quickly

delotel)
Lmpleeutatin Lwsetl)

Seancu
Binay
ree (6S1)

Linleed ist oU)

ol)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

STAGK
O A
limea data tuctue
w
whichi wenten aud
eltis beth
top the te
a
O LIFO Last
In Grst ut) tinni 4o

uihed ust

Lt eleet
wiented:

* Seme wplemeitati iatidex betto


wtich stores tee lnde to wic tep. poutts
wthe
stactk is

u =
Insentiev stack PuSH
Delctie stace POP

Stock Pemutations
sequemee elemet etained
elotain
elweuts

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

element Catala
wumber
o
valid
No e stach pex
wutatieue
poslble

No

pemutatâne

Exawsple

Pex mutat possii


3 2
Puse Rop Roh
HIU 2
J3 (PustPep

2 3
3 2

Not possi ble

valid

13 L3 4

z 5
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

fengormed

sfach
PusH15)
-
PUSH(t8).
- POP Sequee
- PUSH(45) 1815, 15, |5, 15
-fesHS)
- Pop
-Pop.
POP
-l5
-PusHIS)
-
poP.

Multiple Stacks
MethodL
Dne stadieonot
be use the spee
Stacu 2 stack
<-staclel
wtiich loads to
Suitiathy Impoperbi
topl -i ubligatiam
stack spae

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Mehod2
2 stacks stant fom oppose eds tae

stackl -stack 2

Subally,stacks
tapi= -1

Oveilow:
tepl== tep2-)
botz
tep2 = tepl+)

lhatto
Betteu space utilizatv

miiimw
to a stac

Tuso
(2)

lht he minim
implemut
egied n

Tuoo
Ay (2)
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

2 qyuees ne guired.

PUSH

Insert
POP

Deqyueue tom oniaguae)h


Mae

Staces

ENQUEUE -
Pus
elenet to sI.

S2 Aud pop om
4om J1 to

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

(sn) dolate eponodem pitomad


Let onden
(
a a bitaan
and tae
penyoied pectiny

ond 2
<y < 2

and 2 m

D.

WoYst case SCema


inient
Petor eperatin and

DELETION

Total wo'
M+W= 2n Tötal
4 PusH poP

Best case &cemasi


m
Perorww wint operctu, delete feaew an

s2 NSEIO NA
DELETION

Priyanshu (GATE 2024 AIR 379, GATE 2023PUs


AIR 384) @ https://x.com/Priyanshu__2109
Total o

2m
<br>

Applications ot sto.ck
Expressiem Evauatiu
lo(Recwrn -las)+.c)
-((ses)es)
1-Expressiêv, ealwatie Rui's
2ra retix (+ab) oi'sh Notatien

Exprtssiem Intix (atb)


Rererie Pois
Postfix (abt) Nobt

ObeyatoY Preced
ence
Lett
Parethess()
Eponet
t(ssca) -r) Muttp Let

Dþerators

Unau

wany eperatos have


Au buiony operatos
precedened taau
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Cowersiom C3dqqA
to Pretix and Post Poctix
Inte
Lnix
Režn
(2+(3*5)) -! (2+(3*5) -I
2+3*5-l
: (2+{*35) -1 -(2+(35))-1
(2% B35) -235 *+)-)
235 *+|

-2237g

7-6 *3^2/8+9 (7o*(3r2)/)+4 (-(* (3r2)/=


(7-(6(32)) /3) +1
(-((2^)/e)=
Yd

-(et32)/))+4 (1- (6s20)/-)

(1- ((*61329) +4 (7-(G32


*/)=
E/*6^ 328) +4 (76324*8/-) +9

+-1/ *643284 7632 ^* 8-9+

-b -b

Z.

lagl
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

(a+ B) * (C- D)
/F- X*Y jzat d

reix
(A+8) * (e-D) /F*Yjz
(**Y) |z
*co) /F
(tAB)

o1*tAB- cD)]F-/*XYZ)
-
((*+ Ab- cDE) - (/*X1z)

- 3XeyhtdsA

Postfix (A+e ) * (-D) /F - X


»Y]z
(AB+) *
(CD)/F (AY*)|2
- (AB+ CD-*) [F - (xY*Z/)

,*F/)-(XY*zI)
-
ABt CD-*F|XY*Z
AB+

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Post4ix to Infix

e
da'e
atb*C

atbc atb*cTatb*c - dJexf

atb*c- ale*f

Pretx to Dnix
Revenie
tu pretx and
pretx selre y'postt mehod

+-62 *374 aA

473* 2^6 -+
2
7*3 Ts3+ 2
7)12|hx342-6
2NS*)

Aus:
z*3)t2-6 4+(7x3)2-t
(T*3)2-6
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

to prefix post
Conrent the expreSSL ad
-
atb *c dae^f
Pretix coY

a+ (bx-(aa(enf)
A
a+(*bc) - (^ane) A

(taxbc) - (^a^e4)
1((-)5-4 a* be ^dnet

Postfix expyessiew
a+ (b *) -(anea)

a+(be*)

(abc*t) deta).

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

to
Convert wi

D
ha- B #
A
B
(c-) B*(c-D)
A
A TA+ B

Aus
|* Iutix
A+8* (c-D) expresiem

Posttiz Evakuation (xo)n


2 * +
6 - 3d
2. 5 3

2.

32=q 45
5 5T5* 9302
2 2

22+ S= 47 64747-6=4
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Aonithn:
Add parenthesu ) ate end of

wntil )) is encotered
Scam P trom ut to aiglt
counteedy pUSH t
uto stack.

iseuceutered,
i: Pep 2 ewent fom stn
op a aund put e pust
tvaluott lb
heult eto stacl.

O Reult top t stach.

posttte epressiom NOITOUlov


Evaluate
5 +
30
6
5 5 * 3 *

3o3o 61=5
JarsilDtlbt515 15
4207

3
25 3* 3 =75 75
5
I5 315
375
30

8
-
340 t340
=
382
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

5
3

P'hetix Eauotion
Agoitl: at ttae d
Add niglt pareutheis
0
:
wti (uesiterel to
PusH
eucswtered,
Stack.

stack
2
elements fom
i.Evaluat a
teu
euto stock

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

lostix evaluaten
Prehie evalaten

Ques
*
623 4 M2u9 rttun
t 5

Au 5

Ques

/3* 4 + 4 + 5 3

2
12

3/103
36

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Ques mto
Convent

evaate - q
(2+4)*(8-3) / 4 * 2/3
w

Nuwoen 4 patt PusH and PoP eperatio


evaatiin e

(2+6) * (8-3)/4- q *2/3


(62+) *
(83)/4- (42*)3
(G2+33 -*) ]4- (42*3)
(62+83- * 4|) -(923/)
62+83- *
4|92*2/

= 2+1+2+1+|+1+|+ 2+)+!+2
POSH epertiene
No
4
No- ef POP eperetze

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

2 Recur siov
tunctiebrealls it ig
called vecsien

base enct| tuminatign


O
Fumcton seould hae function
Cenditien tor
call itt tue
ca ek
Evey tumtiu
tie tuteuld
bae coudctien coe loe

o")
Recursi

Direct (aj Indinect Wested


Recursi Recuxsiem Recursio

AC)4
tun(tunn)
B)
tunc)
functiu
statewdeut

Activation Record
Wheerer a tunctio call, act' vatkon
(necovd nd puushed'eto tu stack
cctiratien record
cal
is deletad fvom stach

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

ier Actvatien Record ute


parawcn
fuuctiw
Local vaiable.
stzvse !

Que

I 23 4

priag("d,

void waiua )R tunl3)

PL3)

tuuti)

(uto) PL)

Ques
Head (iut ) Readl3)
void
Head2) Headl)
Head (u-);
prandt ("d, ); Headl) Hecdl) HesdlyPe
Head(x- );

L
L
hendls); 12L 3121
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

X(5)

C)+
5
x() + 4
retunn i) -t 2x(3)+
3 xU
else
retun x(w-1) + X(N-3)+)>

Bues

ut X( ut N)
X\5)=7
etuw X(7)7
else
veum ( x(»-)+ x(»-3)+)'xí:) +
x(4)
+ 1

Retuw vale d x(*\s)) xl3) + XU) +|

X4)+ xt) +} xH K)t)


tuuetin x3) +xU) +}
Calls
7
AuE
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Ftbo
n
acci Series

=
fib(n)
fioln-) +
fblw-z)

2
fiol3)
No additiens tor - 2

"tol3)

:5
voiatioue calls
+

fowmctin call
iwwocations 2* fb(n+1) -L
No B
tor
to be tb[n+)'-'
additions dete
No
6.

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Tower e Hano

Transter disce fom


Initial/ steut to eud keep

DFFSET END
START
ti
cisc canst
plaucd VeY Saller
be
TDH(m, Stant, Aux, Eud)

4(w>0)
TDH
(n, Stawt End, Aux)
More L
disk tyom Staut to End.

TOH( -, Aux, tait, End )

(t
Rnte

n
For
dies
movemnts, =, -
dist
ntl
call! 2

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

203
GATE
that iste etn vale
value otp wwityed to 5 betore
te call?
Mote
that t trt paametn i

ushn as econd pae vae


unt
c)
2
12/
4le- o) etunnl

reton (x,c) *;

5)

lrt
tun(6, 4) *

* x -
fu(7,3)

q tun 8,2) *X qx4q-8)


Aus = 656)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

(ousice toe

static ut
i4 (uc-o) retunnl;

rcbann u-) +2; Auu,

ts)
Y=ø5
t(5)
Sors 3) +2
(T) is base

t(2)+5-! ll+5-1b

fU)+5 6+5= I

sks Hlo) +5 1+5=6

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

L-22

TREE
Non uear iinarciial dota sttune tthat cest
(onnected
leveld
Tree
Tenmiogt
leel
ORoot
Node
O Child Intenl
Paeut
leyel
nemoe
* Depta a node: ta leel

-
Hamdshaing LemMa

umbeu e Totul no.


wo
Total
Total Etenal
Nodes (N) Iutnal
wodes (I)

N=I+L

Parenthes is Metod] o Repres utat

Node ild dild2

2(7(2, », 4(!, n), s(a(1)

()

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

tee tron tee tollong path ea represutair .


ustruut the (d
Al
B(,4,5), c(e, E), D(G (79), H, ))

ues sho
-o4

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

al b, e(e (min)

(m)

Huigat e Tree
at ttue patlh 4rom tee oot to tee
No edqei
in
toathest leoy wode.
: (M4)s)A
H(Tree) with
H[Tree) max level uoe

a nod
i3 associated with
* Deph with tie te M)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Binahy Aee
has warimuni 2
cilden
A
tree

Linked Refreeutndnsn i
Lett
key
Child
g
struet BTmoda

stut BTode*Lcild
Shruct BTnode*Rcild,
ab Root
petesh3

b
e

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

a
Let Nlode ?
Hous to deteet 992
4(t ehild
= NULL 22 t> Rchd =
-NUL)
NULL

t peue b wode

2
modes clidew

&ues
o: wodes
In thee the 2 23
and tree?
wodes
Total
No: wodes (): t| 23t| 24

No tutinul ||+23 34

Total o
uode: 24f 34 : 58

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

tuat can be

No. lony tees wlabeled Catala


tustucted usig
ASwodes

tee taat i ca be s
2n Cw
Censt cted wth dtimet heys

moe
Maimum ad minu a
thee at
level woer L: waxinn

Minimum aund maxiwm unla H+1


binauy imm
*maximn

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

yenenal Tree wto


wmto Bunany tree
Comversn
thee
Binny Tree Repretatiw gnal
RepresentakaM
Letmast Child kigt sibling
wode e
Lelt chld ot ietwost chd
lainany tu
the tee

20be

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Thuee Trovehsal

Pre order t ab) rohroizo!


ohyntsa3 az Let clidd
Inorder at b) t=b Root
ostorde (albt)
() piglt ditd

stlshroto)
Preorder finctiowq
void Preorder struct BTNode *t)

4(t)1
(1-d", tee t-datn),
printt
Preovdei(t lttid );
Rreordey
(tRgit clia );
thsrds
Inordéx Functien
Void Inorder styuct BTNode #t)
i4(e)4
Thorder (t >lethid);
pit (6 "dy te tdat);

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Postorder Fumctien
Postorder ( stut BTNode *t)
void

Postorder (t> llt ld);


Poctorder (t> Rigt cid;
- pint} ("1d, t> data;
L
oula } rohroari biov

Exawples
dlEt
Preorder : a bcdet
:
Iuorder cbaedt
Rostorder : cbeda
bio

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

e 4 g
Reor der ab
Jnorder
Postorder
et dbij

keve Oxden Thaversal

tevel
OYder
abe tde g

Trarersal

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Constructig Tree wg Traversals


- e
slsud
2 taversal ae uguired
Minimn
loe worde

Bxample
6
PreordeY: | 2 3 4 5
InordeY: 2 3
5 4 6

Preorder: mno P 2

9
Postorder :

:
Inordei

eovvee pastorder
Preorder trarenal
Rerenso
worden Thordes trversal
Cee

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

* Preordey and Postorden arsals


ode wil haneegiecthen
a
bee ey wlhen
hildhe
00Y 2

m
Paeorder : abeki nct 9 h.
h

(my

e Tree
[Heinht

wt Height ( stut BTNode *t)

retuu -1;
e
else
return max( Heiglt(t slehild),o

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

btwode *t)
void Do ( Stuet

bo (t-> kigutclid);

J
I! rbros
lhat wll be te hhal bree att fe
above tumetin
tuee ?

followug tnctis
Conido te n stuct BTNlode *t)
STNOde vod
void m(stet
nltleteild); data);
priut} ("c t m(t>letcild);
m(t>ligltca);

girew tee
Get
tu va wtt) for
ti

BDEA cF

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

m(A)

n6)
PCA )

m(F)
PLe) m(D)
(P(F))
)

Bues
Conaiden tae feleg kutin *t)
m
( stuct BTNode *t) void n( styuct BTNode
void toirt2
printt ("t data );

pit(e", t> data),; mlt>ettcuild),


wts Rstcld ;

BDEACFG

wit)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Types of_Bircy TTiees

1. Binay Iree
Complete
Bnarybee iu wtich possi
counpletly tlad
fe iat, modos
utastlevel pocible.

2: Styict Complt
Buayroeoutr3 s
ee
iw wih eey evel is

bey stict
biuany tee
Covplete
rere i
tree bt
wst
tu

Tree

1
at wdex
Reot

Let ild :

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Tree
3. Full Binoy
also colled mopu binay eong
wode eitinen0 OY
2
ctde

*
Total wumiber o nodes

aloag
dd valei

3-Avy Tre

each mod has


O
TOY
3 clde
t tene ne I wtennal node
y

No 2I+1

K-
AryTee
eacdh node OY k-ildre
wodes
e
iutnnal
L: -)I +|

N kI +|

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

bune
Tree.
Shewed
4. Let wode luld.
utennal
Evey

igint Skewed Bunay Tree


5. wode has
utevnal wode hid

ued to vepreseut expresie


epexotor root

Let operand
: lett dild
YO

atb*G
atb

b)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

2+7*3 2 /4

Drauw expresiem tee tor


&
Pi,

(og

Quey

Drauw expressie thee tor

2- 5 *7/|* 8+ 6^ 3 (2+9)

te 5

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Tre o
Binahy search
elemete tehe t wbtree hare
Au th
tee eot
Valu tea
have
tue iglt bubtee
val

18, 15, 8,19, 21, 35, 23, l, 4, l6, 3, 1, 20

18
5

(23

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Deleti w
BST
wode BST Aso, heep trck
Search tor tu
tehe
t odu
panet
node
Nodeto delctd
ttede to Paut
ttue wod: *paset.

CASE. 1: The

pehent Lehild )
porent
14lwod= ->
ponamt AL NULL
Leild
=

panetRcd NULL

free(woda)

CASE 2: The mode ha ee cild

mode Lhild,
else
wode Rehild;

panutLeiild).
L pausutLuild
=
ild;

pauent Relild diild;Grat


Ly

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

The node ha 2. ei ldren.


CASE3
Keplace tu node witth ordn suceeOY
PreaeceMor.
succesor predaceso4
elot tte orde

50
30 60
30 65
20 40 55 65 Delete bo r
/
35
Delato 35 )
20 40 55

38
32 38

34
34

o(w)
Sennebig
O(H)
Insesti
jsals
Deletin

Inorden traver sal BST lsetd

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

trawersal BST 15, 10, 5;, 12, 19,6


preord inorder
anersal?
traversal?
what i
|4
(aucending ordu)
15 lb
5

from preovdw
trorersal Simpt
(utru ctig a BsT
BsT
ae e
lby
Iuent elets

1 BST
The preojde trarersal et
2 7
12
postordu rawrsal)
tosterea assal
12

9
/
2 Lo

, s, 17, 20; 14,6,


Postord 2-,7, 6, 0, 8,

a BST trom postord frowersal


SinnpLE
Luet elenits r

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Ques A
4 3 9 13 7
Postor dun troversal i 2
Preorelen
troversal

Preorde
raveral 5 6 3 22 4 7
T23
3 9 18 17:2

BST canst be onttrncded worce


tyaireni qwen

m
distivet nt
n
distiet
modes

Tree 2ncn
Binay nt)

Bunany Seanch Tree

uubu

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Ques
when seanclig vale w a BST.

values 0 20 H0 507070
5o 80 q0
8O

traversed
W

Same erden).
possible
m
utuch
ordns
tee seanch path
vale
to coute'ng vae Go

60
No:

No
t ordes possible :

AVL Tee
balamcng ina Searchn Tree

thee
Balauced =
tor each mode
oae toctor

Balanee'tactor

B-f2
6f= O

belouned

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

a
Tree
de to setioM or, deleti
Typu eImbalauces
1- LL Imbalanee ( Let let wbaauce)
LL Rotaten

LL Rotaen

Tnsede0
.
(60
Rotatuen
(45) (45) at s

(2

2 RR ImbalameA (Riqit Riglt onoalame)


RR Rotatien
Sglo etstatin
RR Yotaln

2
50)
Tu t 90
(40 RR
Yotalu
(6).

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

3. LR Imbalamee (Let Ragt Imalannee)


SetY RR rotoden t UL otatnn
(3 (o)
RR otakion L
otin

Iwyet 25,
RR Yotou
30 60)
C

LL ten
(60)

4. RL Imoalaee ( Riget Let Iwbalauee)

LL Yotottn
60 49

RR Yothen
(re) (60

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

AVL Tree Insetion


Insehtt per BsST wtien
uode
(staut tomm
put auty iuetd
iuented wode &woe
towaide ot)

Exawple
-
(austt AVL tree 3 2 5 6

-2

(4

(6 3

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

, 15,1 6
25 27, 40, 8, 5, 3, 24 ol7i; 15 2,

sor(25
(21os (40)

1(2s) 1(27)
I(40)

(4o)

I(8)

(49)

(13
3

(29)
(13)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

AVL Tree Delotien


deletien BST
PDeleti tee eleet
Pueck ko wbalaee
tugl agpropnt otalon.
imbalaee

Cases
LL rotao
LL
(ov)
LA
Lo RR
RL
L-)

Fxample

(81)

-2 Delcte 2
5)
RR

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Le

Deltu l
Delstu 5

(4)

(13

Delete8. 6 RR
votet 13

beletb 13
Delt

yo)

Delctl5
4o)

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

nodes
Minimww ubn
w AVL tee 2
H=1
H

Het a
tree 2 3 4 5 7
Mimimuw
2) 4 12. 33 54 88.

Max igt AvL tree ot wodes an guicn

.)e

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

HEAP
taee loaued dot stutwe &NE

te

baed doda stelwe


voal geatat
Mim heo vale
()

Reot at
mode at wdes

(20)
20 I5 12 G)
2

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

w
Insentow

Lnset 20)
(20)

(10) 5)
12 (2

Insetl5

Iuet4o (0) Aajuit,

(y0)
(()

4ujut
Adjust
(12

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

4 |0 3
Butd Mw hep:
Twello
4 lnset3 Adjust, Iustts
(o)
5
3 Adiat
Tuwetl

Runtime complexby
Insenting elem
elemet L

IusectiA n
lmevte

Buildg ap bt o()
WAethod

Deletien
e place tee lart wd
Delate aeet elemt
t Lot
keopti

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

92

Numen heap with


N
dutct
(o

trom

Root t te tree Swne ww heap)


3
No ft sebtree
3
Slotree

T(3)-T( 2)
torwaed

T calulate T(3) -
T) T)
2
*l* L 2
taso
T(3

2* x22

30
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Heap soht
Ruuntine cwmpenty o(nnog) o(dog)

GRAPH
and
inea datan stuctu os.
- [pb}jao
ap

ee dnedien:

Dndirected qap
Eagu
diretn

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

qrap Repreaetaton
Tolole Matig
MXn wati wodsa (vetees

2 3

D
2
3

ewt.

2- Linced ( uet) ReprereytotieM


nodes ut tor
Coutáw

L
2
2 3

30,!
3

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Vet'e
w
aayiveghqrvo

Veytices

X! b

3&

Thavoning
1. Breadth irst Seanch BPS)

inplemudtad

SourceC

CAEBFD

Brs(u)
Mak visuted and Eney

flnd l
wnnsieod

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

DES)
2 Deptt Prst Seascla (
Cimplemntd g taek

Seurce A

Traversal
ABDEFG

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

NASHENG
puovice heeult
u
castut twe
Seanehing techniqyue

Hasling Techuityu qeuerat tee addresJ


tocaten
2. Sustractie
3
Divisien
4. Fold method
Mothod
5. Fold
Mothod

os 1, DIRECT,H ASHING
,s5
H(k) 2kden!
c o
posci ble bey t be stored 49

Disadv liwutd ocatin


Oao<
2. SuBTRACT\ON HASH|NG
tve

-3
possible ey 3 to 102

wvwtd Locaten vaug


Disadv

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

3. DIviSION METHOD Modulo Duviion metusd)


usually

Adv: wito d

isadvi parible
clisien postble
bortta
baslia4

4. FoLD SHIFTING METHOD

Locati erm
pniteA H
Form
get fe Locatièn n hash tasle
(63

666batuen.

M01TDA9TAUe

T5. FoLD BouNDARY METHOD


Cocatoyn rag) 000-q4
for 3 ou at sndaies
to
add teren
and
(23
lyi- 234 T2 6B5 63
locaton

tsuwz1o00

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

6
DlGT EXTRACTION METHOD
Locatsn rang

l,3,4

629 8 4 3;
(9JF

694- ocaten

7. MiDŠQUAREMETHOD
Tale pde middle
dgits.

rosriJ

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Collision
situatiu terot wt
tuo ditnt thave

Loys to
inet- 12,5

Dpe Addreasing
Closed Addressng
(opue hasting)

Quodiatw prola
Rad
Deulble

L-
Lineo probing

to toYe ceidd.
Applicate m

Talole Lnw Lti) wd


Sywe

Dotlases
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

* Linea Paimay cdusting


probg
Ruaditie

2-Quadhiatic phobing
L= H(K)
Celicion at L

wtene l,23,4,..
(L+i) wod
sutfeu trom secoud crtuig

3. Random phobi
L= H(k) at Locati
L

Col'ien

4. Double
L=
4O clisiew at Locan
Hx)
--
t=l,2, 3,

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

h Chainin9
oleut wtc have Cawne asth vale ae itred
w
at Locaten
lined lut
pridanq
2
12 wod
102 3
2
13 mod l

Closed A ddre
Open Adaressinydas (Gpe Hastig)
(cosed Hasling)
then ocatim
addresS9e
to loe qeat
locotim tene, othen
to be qemeroteiH 9ldvog
O
Linited iunwoer 4
eemto Oimitd elet!
be red. l tortd

No oveloo.

Deition wt posgaie Deletin porebte

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Clusterin
segusnee of preoccupad pastio
Lag place
stil at

d. Seeonday utng
Longen, ai wmasdy at
becee

Quadiatie probg

Load Facto
pen slot
Average
ebe ot leys

load ttor

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

tillzaten
Space
arrirsteu.
Cpoee

DSpae
Fox
pe adarog
for closed addresg

Perfeet Haking Yos07 boo


wctet
ane wsetd
Lelliiien, 4ee| peueet

Minimal Peect Hauuing


wald
to be

laye iuetid w/o cowsin

eleuents
Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109
<br>

Unigorm Hashing
hase tumction teat Locatiu
a

Priyanshu (GATE 2024 AIR 379, GATE 2023 AIR 384) @ https://x.com/Priyanshu__2109

You might also like