When will it be announced?
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
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 |
---|