When will it be announced?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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!!
Название |
---|