I need to use a data structure which supports constant time lookups on average. I think that using a `std::unordered_map` is a good way to do it. My data is a "collection" of numbers.

```
|115|190|380|265|

```

These numbers do not have to be in a particular order. I need to have about `O(1)` time to determine whether or not a given number exists in this data structure. I have the idea of using a `std::unordered_map`, which is actually a hash table (am I correct?). So the numbers will be keys, and then I would just have dummy values.

So basically I first need to determine if the key matching a given number exists in the data structure, and I run some algorithm based on that condition. And independently of that condition I also want to update a particular key. Let's say `190`, and I want to add `20` to it, so now the key would be `210`.
And now the data structure would look like this:

```
|115|210|380|265|

```

The reason I want to do this is because I have a recursive algorithm which traverses a binary search tree. Each node has an `int value`, and two pointers to the left and right nodes. When a leaf node is reached, I need to create a new field in the "hash table" data structure holding the `current_node->value`. Then when I go back up the tree in the recursion, I need to successively add each of the node's value to the previous sum stored in the key. And the reason why my data structure (which I suggest should be a `std::unordered_map`) has multiple fields of numbers is because each one of them represents a unique path going from a leaf node up the tree to a certain node in the middle. I check if the sum of all the values of the nodes on the path from the leaf going up to a given node is equal to the value of that node. So basically into each key is added the current value of the node, storing the sum of all the nodes on that path. I need to scan that data structure to determine if any one of the fields or keys is equal to the value of the current node. Also I want to insert new values into the data structure in near constant time. This is for competitive programming, and I would hesitate to use a `std::vector` because looking up an element and inserting an element takes linear time, I think. That would screw up my time complexity. Maybe I should use another data structure other than a `std::unordered_map`?