ome Assignment —A 7 1OO08O12-s”
QM] Explain the concep of seqmend tree with an
ExamMPle -
= Seqmens Aree fe
= The seqment tree is OF
Of doto structure From Computational Jeometry
Bemticy ProPosed this Wen -Krowo deel nique to
IN44. A Seqmeny tice 1S Esseotany G binary
Ayee Gn Whole nodes we Store dhe information
Obout the Seqments of O linear dota Structure
Such a: An Arvoy.
unAdcy standing she Seamend Tree method wit
On €xampPite ‘~
Dement Trees cam be Used 46
Soive RANJe min| max @ SUM Queries & RANGE
Update Queries in OC109n) dime. Mhese Prolbotém:
Can be Gasi1y Soived with the Seqment 412
FechOique- Use Can study 4his method by Serving)
Such Probie efficitntiy.
FA, seqment Tree has omy three OPperatioen:
*-BUNGiNG WEE — ry this step
Styuciure OF the Seqment Avee 4
pike 33 = ad
updating tree} durt
Ahe tree by uPpdati
Gta Point ov EvQver ‘ ‘i
UEYHIAA TWEE ye may vise This OPCYALION
do run o Tange query on Ane array,
CONstruching o segment Tree 7
T's aoinavy Arce , We Knew thot the chitd
nates im Grvay TePYeEsentarion FOr Node tn) Ov"
KO & DARI. ALO Vesurt each BLement 19
Ane Seqmend tree (sh) wit) be stipe stl try
w+ StLoae ier],
where “4° te the node's ander. & the leat node
rePpresemts Ahe elements ta the array CA).
id21OOO FOLD S
The Avvay 18 visible OM Vhe \eal OF the dee
seat [eps]
UPAAAIDG a Vavue in Vhe Seqenerh Tree tf
To LPdate A Valuc, We CAM sinnPIy de ev one
Ane Avfl, which ig the difference bel\ucen |
dhe New Value of an element & the Curvemt
Var: