Library/Data Structures
2020-08-26 09:10:32 -05:00
..
dynamic_segment_tree.cpp Update dynamic_segment_tree.cpp 2020-05-02 20:46:33 -05:00
dynamic_segment_tree_2d.cpp Enforce consistent style 2020-08-21 11:42:33 -05:00
fenwick_tree.cpp Update fenwick_tree.cpp 2020-07-17 23:06:42 -05:00
fenwick_tree_2d.cpp Update fenwick_tree_2d.cpp 2020-06-26 11:51:11 -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-06-02 21:44:36 -05:00
seg_fenwick_tree.cpp Enforce consistent style 2020-08-21 11:44:01 -05:00
seg_ordered_set_tree.cpp Enforce consistent style 2020-08-21 11:44:01 -05:00
segment_tree.cpp Cleanup 2020-08-26 09:10:32 -05:00
sparse_table.cpp Update sparse_table.cpp 2019-08-02 22:03:09 -05:00
union-find_disjoint_set.cpp update 2020-06-14 11:15:37 -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)