forked from Yashasv-Prajapati/LSM-Trees
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
66 lines (62 loc) · 1.03 KB
/
main.cpp
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include<iostream>
#include<string>
#include "rbtree.h"
#include "compaction.h"
#include "read.h"
using namespace std;
int main()
{
while(1)
{
cout << "1. Insert(predefined file) \n2. Delete\n3. Search\n4. Exit" << endl;
int num;
cin >> num;
if(num == 1)
{
mainInsert();
Compaction();
//mainCompaction();
}
else if(num == 2)
{
string del;
cout << "Enter key to Delete: ";
cin >> del;
int k = DeleteKey(del);
if (k == 1)
{
cout << "Delete Successful" << endl;
}
else
{
cout << "Delete Unsuccessful" << endl;
}
//mainDelete();
}
else if(num == 3)
{
string srch;
cout << "Enter string to Search: ";
cin >> srch;
int k = SearchInDisk(srch);
//cout<<k<<endl;
if (k != -1)
{
cout << "Value: " << k << endl;
}
else
{
cout << "Not Found" << endl;
}
//mainSearch();
}
else if(num == 4)
{
exit(0);
}
else
{
cout << "Invalid Input" << endl;
}
}
}