-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
52 lines (44 loc) · 1.18 KB
/
test.cpp
File metadata and controls
52 lines (44 loc) · 1.18 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
#include "Structure.h"
#include <iostream>
using std::cout;
using std::endl;
main()
{
Structure< int > *hash;
int i;
int *data;
int key;
cout << "STARTED\n";
hash = new Structure< int >();
data = new int;
cout << endl << "Address of data is " << data;
i = 0;
for( i=0; i< 1000; i++ )
{
data = new int;
*data = i + 1;
cout << "\nAdding key " << i+1 << " with data " << *data << "\n";
bool echo = hash->MLH_insert( i + 1, data );
cout << "\nOperation report: " << echo << "\nPrinting List:";// << hash << "n";
// hash->MLH_set_print(1);
cout << *hash;
}
cout << "Counter is " << hash->getcounter() << endl;
for (i = 0; i < 1000; i++)
{
cout << "\nnow delete " << i + 1 << "\n";
hash->MLH_delete(i + 1);
cout << "after deletion\n";
// hash->MLH_set_print(1);
cout << *hash;
}
cout << "Counter is " << hash->getcounter() << endl;
for( i=0; i< 100; i++ )
{
*data = i + 1;
cout << "\nAdding key " << i+1 << " with data " << *data << "\n";
bool echo = hash->MLH_insert( i + 1, data );
cout << "\nOperation report: " << echo << "\nPrinting List:";
cout << *hash;
}
}