We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7843e7a commit 8e37824Copy full SHA for 8e37824
21- Hashing/hashtable.h
@@ -19,7 +19,6 @@ class Node{
19
}
20
21
};
22
-
23
template<typename T>
24
class Hashtable{
25
Node<T>**table; //pointer to an array of an pointers
21- Hashing/searchKey.cpp
@@ -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;
+ }
+ else{
+ cout<<"Price is "<<*price<<endl;
+ return 0;
+}
21- Hashing/searchKey.h
0 commit comments