I have an array that contains some hash values of certain strings,
I don\'t want duplicate values in my array so I use if
logic like this
if(!a
as my list is not sorted so i have create a dictionary and put values into it after checking if value present in it or not . Here in this dictionary my value and key are same .
var arrayOfHashMap = {};/*is a dictionary,arrayOfValue is a list*/
if(arrayOfHashMap[hash_value] !=hash_value){
arrayOfValue.push(hash_value);
arrayOfHashMap[hash_value]=hash_value;
}
in this case I search values in o(1) time and put them in arrayOfValue