-
Notifications
You must be signed in to change notification settings - Fork 1
/
Telephone_Directory.h
45 lines (43 loc) · 1016 Bytes
/
Telephone_Directory.h
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
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Phone_Directory
{
struct node
{
int count ; //For storing the frequency of a node
string phone_num;
string name;
node *left;
node *right;
node()
{
count = 0;
}
};
public:
static int count;
Phone_Directory();
~Phone_Directory();
node *nullRecord, *root;
void Insert_Record(string, string);
void Delete_Record(string);
void splay(string, node *&);
bool contains(string);
bool Is_Empty();
void Make_Empty(node *&);
void Display_Records(node *);
void print(node *&);
void rotate_with_left_child(node *&);
void rotate_with_right_child(node *&);
void search_key(string);
void Partial_Matches(string);
void Partial_Matches_Name(string);
void Frequent_keys();
void sort(vector<node *>&);
void search_by_name(const string &);
bool name_found( string &);
void search_by_name(node * n, const string &);
bool name_found(node * n, const string &);
};