Skip to content

Commit 8e37824

Browse files
committed
codewithdev#3 Updated
1 parent 7843e7a commit 8e37824

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

21- Hashing/hashtable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class Node{
1919
}
2020
}
2121
};
22-
2322
template<typename T>
2423
class Hashtable{
2524
Node<T>**table; //pointer to an array of an pointers

21- Hashing/searchKey.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include<iostream>
2+
#include<cstring>
3+
#include "hashtable.h"
4+
5+
using namespace std;
6+
int main(){
7+
hashtable<int>price_menu;
8+
price_menu.insert("Burger",100);
9+
price_menu.insert("Pizza",120);
10+
price_menu.insert("Potato",160);
11+
price_menu.insert("IceCream",130);
12+
price_menu.insert("Coldrink",190);
13+
price_menu.insert("Samosa",10)
14+
price_menu.print();
15+
16+
int *price= price_menu.search("IceCream");
17+
if(price==NULL){
18+
cout<<"Not Found"<<endl;
19+
}
20+
else{
21+
cout<<"Price is "<<*price<<endl;
22+
}
23+
return 0;
24+
}

21- Hashing/searchKey.h

Whitespace-only changes.

0 commit comments

Comments
 (0)