When will it be announced?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3741 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3489 |
7 | Radewoosh | 3483 |
8 | Kevin114514 | 3442 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
2 | atcoder_official | 162 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
When will it be announced?
So I'm solving a problem that I think requires a binary search tree.
Is it possible to query for the maximum value on a key range? For example, for a node, I have the key be the "time", and the value be some arbitrary number. Is it possible to query for the maximum value where the key is on a range [a, b]? (In logarithmic time).
I googled for range trees and stuff, but those talk about reporting the points on a specified range, which is O(logN + K) where K is the number of points reported. I just want to query for a maximum value (to speed up dynamic programming).
UPDATE: Uh, the points are way too large to actually build a segment tree on it. That's why I'm using a binary search tree. (I already know I can build a seg-tree, but the points are too large, even after compression).
Thanks!
Hi,
I see a lot of solutions use these terms interchangeably, especially Range Tree and Segment Tree. I know how to implement a segment tree very well because I've done it multiple times in problems. However, not an interval tree or range tree. Do you need a heap like tree, or do you need a self balancing BST for it (I can't implement any at the moment. which ones should I learn)? Also, according to the wikipedia article, you can query the number of points in a 1-D, 2-D, or n-Dimensional area using a range tree, but can't you do the same thing with a 1-D, 2-D, or n-D Fenwick (Binary Indexed) Tree?
Please, someone answer me, and maybe give examples of problems solvable using a range tree?
Your help is very appreciated!!
Name |
---|