Library/Data Structures
2020-05-13 12:48:29 -05:00
..
dynamic_segment_tree.cpp Update dynamic_segment_tree.cpp 2020-05-02 20:46:33 -05:00
dynamic_segment_tree_2d.cpp updating libraries 2019-09-03 21:43:14 -05:00
fenwick_tree.cpp update fenwick tree 2020-04-20 22:22:35 -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 Update README.md 2020-05-13 12:48:29 -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 bugfix 2020-04-07 19:32:48 -05:00
segment_tree_v3.cpp Update segment_tree_v3.cpp 2020-05-10 10:43:54 -05:00
sparse_table.cpp Update sparse_table.cpp 2019-08-02 22:03:09 -05:00
union-find_disjoint_set.cpp Update union-find_disjoint_set.cpp 2020-04-24 16:39:57 -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) 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