| 6 | vector<pair<int,int>> bucket[100]; //bucket is an array whose each element is a vector of pair |
| 7 | |
| 8 | void put(int key, int value) { |
| 9 | int index = key%100; |
| 10 | for(int i=0 ; i<bucket[index].size(); i++){ |
| 11 | if(bucket[index][i].first==key){ |
| 12 | bucket[index][i].second=value; |
| 13 | return; |
| 14 | } |
| 15 | } |
| 16 | bucket[index].push_back({key,value}); |
| 17 | } |
| 18 | |
| 19 | int get(int key) { |
| 20 | int index = key%100; |
no test coverage detected