|
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Segment Tree, to store heavy chains. More...
Private Member Functions | |
| X | combine (X lhs, X rhs) |
| Function that specifies the type of operation involved when segments are combined. More... | |
| SG (int size) | |
| Class parameterized constructor. Resizes the and initilizes the data members. More... | |
| void | update (int p, X v) |
| Update the value at a node. More... | |
| X | query (int l, int r) |
| Make a range query from node label l to node label r. More... | |
| void | set_sret_init (X new_sret_init) |
| Set the initialization for the query data type, based on requirement. More... | |
Private Attributes | |
| std::vector< X > | s_tree |
| Everything here is private, and can only be accessed through the methods, in the derived class (HLD) More... | |
| int | s_size |
| number of leaves in the segment tree | |
| X | sret_init = 0 |
| inital query return value | |
Friends | |
| template<typename T > | |
| class | HLD |
Segment Tree, to store heavy chains.
| the | data type of the values stored in the tree nodes |
|
inlineexplicitprivate |
Class parameterized constructor. Resizes the and initilizes the data members.
| nodes | the total number of nodes in the tree |
|
inlineprivate |
Function that specifies the type of operation involved when segments are combined.
| lhs | the left segment |
| rhs | the right segment |
|
inlineprivate |
Make a range query from node label l to node label r.
| l | node label where the path starts |
| r | node label where the path ends |
|
inlineprivate |
|
inlineprivate |
|
private |
Everything here is private, and can only be accessed through the methods, in the derived class (HLD)
the segment tree, stored as a vector