unordered_map<vector,vector<vector>> m;
how to insert,search delete elements in such case where there is array of strings or integers or 2d vectors inside the map;
Algo(C++) Hashing using STL
Hey Harshal, in unordered_map you can take primitive data types only as a key. And for inserting, searching and deleting in unordered_map<string, vector> m; you have to perform these operations manually by accessing value vector using the key string, you can’t do it by using any pre-defined function.
it means that that i cannot use iterators or use loop to insert,delete in such a case;
Hey Harshal, you have to first build the value i.e vector and then you can insert that value along with the using insert function. or similarly you can delete the value(i.e vector) but you can’t insert or delete any element of value directly by using insert or delete functions.
can you give me a example which explain the working ?
Yes, you can refer this link, it shows how you insert elements in a vector similar is for vector<vector>
you just need 2 nested loops for that.