Skip to content

SegmentTree-aisd/segment-tree-realization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

🌳 SEGMENT TREE 🌳

Here you can find realization of segment tree, an useful data structure used to store information and calculate a lot of functions on ranges effectively. The only limitation - this function must be associative.

🌳 Implemented features:

  • segment tree for getting sum on range [i, j] of initial array + updating one element
  • segment tree for getting max number on range [i, j] of initial array
  • persistent segment tree
  • segment tree with lazy propagation (updating whole ranges)

🌳 Complexity:

Building tree - O(n)
Range Sum Query / Range Max Query - O(logn)
Updating one element - O(logn)

🌳 Team:

May, 2021
11-001 ITIS KFU