-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (38 loc) · 1.03 KB
/
main.cpp
File metadata and controls
52 lines (38 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//Jared Craddock
#include <iostream>
#include "chaining.cpp"
#include "probing.cpp"
#include "minheap.cpp"
using namespace std;
int hashFunction(std::string theString)
{
int sum = 0;
for (int i = 0; i < theString.length(); i++)
{
sum += theString[i];
}
return sum % 1000;
}
int main()
{
chaining* table = new chaining;
table->insert("AB");
table->insert("BA");
table->print();
std::cout<<"Look in chainingoutput.txt to see chaining results" <<std::endl;
probing aTable;
aTable.insert("AB",hashFunction("AB"));
aTable.insert("BA",hashFunction("BA"));
aTable.print();
std::cout<<"Look in probingoutput.txt to see probing results" <<std::endl;
std::cout<<"=================================="<<std::endl;
std::cout<<"Heap Test"<<std::endl;
std::cout<<"=================================="<<std::endl;
minHeap a;
a.populate(5);
a.populate(59);
a.populate(2);
a.populate(8);
a.removeMin();
return 0;
}