Library/Data Structures
2019-11-27 21:20:11 -06:00
..
dynamic_segment_tree.cpp updating libraries 2019-09-03 21:43:14 -05:00
dynamic_segment_tree_2d.cpp updating libraries 2019-09-03 21:43:14 -05:00
fenwick_tree.cpp Updated libaries 2019-09-16 22:08:32 -05:00
fenwick_tree_2d.cpp updating libraries 2019-09-03 21:43:14 -05:00
optimized_segment_tree.cpp updating libraries 2019-09-03 21:43:14 -05:00
quadtree.cpp Create quadtree.cpp 2019-07-26 11:16:10 -05:00
README.md Create README.md 2019-08-01 16:52:02 -05:00
seg_fenwick_tree.cpp updating libraries 2019-09-03 21:43:14 -05:00
segment_tree.cpp Create segment_tree.cpp 2019-07-26 11:17:00 -05:00
segment_tree_v2.cpp update 2019-11-27 21:20:11 -06:00
sparse_table.cpp Update sparse_table.cpp 2019-08-02 22:03:09 -05:00
union-find_disjoint_set.cpp updating libraries 2019-09-03 21:43:14 -05:00

Complexity Table

Data Structure Storage* Build Point Update Range Update Point Query Range Query
Segment Tree O(n) O(n) O(log n) O(log n) O(log n) O(log n)
Fenwick Tree O(n) O(n) O(log n) - O(log n) O(log n)
Sparse Table O(n log n) O(n log n) - - O(1) O(1)
Segment Tree (2D) O(n2) O(n) O(log2 n) O(log2 n) O(log2 n) O(log2 n)
Fenwick Tree (2D) O(n2) O(n) O(log2 n) - O(log2 n) O(log2 n)
Quadtree O(n2) O(n) O(log n) O(log n) O(log n) O(n)

*Without compression