![]() |
TheAlgorithms/C++ 1.0.0
All the 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. | |
| SG (int size) | |
| Class parameterized constructor. Resizes the and initilizes the data members. | |
| void | update (int p, X v) |
| Update the value at a node. | |
| X | query (int l, int r) |
| Make a range query from node label l to node label r. | |
| void | set_sret_init (X new_sret_init) |
| Set the initialization for the query data type, based on requirement. | |
Private Attributes | |
| std::vector< X > | s_tree |
| Everything here is private, and can only be accessed through the methods, in the derived class (HLD) | |
| 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 |
Definition at line 257 of file heavy_light_decomposition.cpp.
|
inlineexplicitprivate |
Class parameterized constructor. Resizes the and initilizes the data members.
| nodes | the total number of nodes in the tree |
Definition at line 286 of file heavy_light_decomposition.cpp.
|
inlineprivate |
Function that specifies the type of operation involved when segments are combined.
| lhs | the left segment |
| rhs | the right segment |
Definition at line 278 of file heavy_light_decomposition.cpp.
|
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 |
Definition at line 309 of file heavy_light_decomposition.cpp.
|
inlineprivate |
Set the initialization for the query data type, based on requirement.
Change the sret_init, based on requirement:
| new_sret_init | the new init |
Definition at line 334 of file heavy_light_decomposition.cpp.
|
inlineprivate |
Definition at line 269 of file heavy_light_decomposition.cpp.
|
private |
number of leaves in the segment tree
Definition at line 266 of file heavy_light_decomposition.cpp.
|
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
Definition at line 265 of file heavy_light_decomposition.cpp.
|
private |
inital query return value
Definition at line 267 of file heavy_light_decomposition.cpp.