Skip to content

Files

Latest commit

 

History

History

A-AdvancedDataStructures

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

#Segment Tree ###Definition :- Segment Tree is used in cases where there are multiple range queries on array and modifications of elements of the same array. For example, finding the sum of all the elements in an array from indices L to R, or finding the minimum (famously known as Range Minumum Query problem) of all the elements in an array from indices L to R.

Time Complexity for Update - O(log N) Time Complexity for bulding a Segment Tree - O(N) Time Complexity to query - O(log N)