Sir I have written a code regarding hashing and it is not working in my pc. Please help asap.
#include
#include
#include
//#include<bits/stdc++.h>
using namespace std;
int main() {
// cout<<“Hello World!”;
unordered_map<string,int> m;
m[“Mango”]=100;
//Second Insert
m.insert(“Apple”,100);
if(m.count(“Apple”)==1)
{
cout<<“Price of the Apple is”<<m[“Apple”];
}
if(m.count("Guava")==0)
{
cout<<"Guava doesn't exists.";
}
m["Guava"]=m["Mango"]+90;
cout<<"Price of the Guava is"<<m["Guava"];
//Iterators to Search
auto f=m.find("Mango");
if(f!=m.end)
{
cout<<"Price of the Mango is"<<f->second<<endl;
}
else
{
cout<<"Mango doesn't exits."
}
m.erase("Mango");
}