Library/Data Structures
2019-08-02 22:03:09 -05:00
..
dynamic_segment_tree.cpp Create dynamic_segment_tree.cpp 2019-07-26 21:14:04 -05:00
dynamic_segment_tree_2d.cpp Rename dynamic_segment_tree_2d to dynamic_segment_tree_2d.cpp 2019-07-26 21:14:16 -05:00
fenwick_tree.cpp Create fenwick_tree.cpp 2019-07-16 12:06:14 -07:00
fenwick_tree_2d.cpp Update fenwick_tree_2d.cpp 2019-07-27 17:56:20 -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
segment_tree.cpp Create segment_tree.cpp 2019-07-26 11:17:00 -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 2019-07-19 12:50:49 -07: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