✔ [JAVA] | TreeMap
\nclass NumberContainers {\n    TreeMap<Integer,Integer> map;                   // The map is sorted according to the natural ordering of its keys\n\n    public
```\nclass NumberContainers {\n    TreeMap<Integer,Integer> map;                   // The map is sorted according to the natural ordering of its keys\n\n    public NumberContainers() {\n        map=new TreeMap<>();\n    }\n    \n    public void change(int index, int number) {\n        map.put(index,number);\n    }\n    \n    public int find(int number) {\n        \n        for(int key:map.keySet()){\n            if(map.get(key) == number)              // We will return the smallest index that contains a number since Sorted\n            return key;\n        }\n        return -1;                                  // If number not present in map return -1;\n    }\n}\n   \n```
['Tree', 'Java']