-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbst.h
More file actions
38 lines (29 loc) · 795 Bytes
/
bst.h
File metadata and controls
38 lines (29 loc) · 795 Bytes
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
// do not change this file except within the private section
#ifndef BST_H
#define BST_H
#include "data.h"
class BST // a Binary Search Tree (BST)
{
public:
BST(int capacity = 5); // constructor (default if no arg supplied)
BST(const BST& aTable); // copy constructor
~BST(); // destructor
void insert(const data& aData);
bool remove(const char *key);
bool retrieve(const char *key, data& aData) const;
void displayArrayOrder(ostream& out) const;
void displayPreOrder(ostream& out) const;
void displayInOrder(ostream& out) const;
void displayPostOrder(ostream& out) const;
int getSize(void) const;
private:
struct item
{
bool empty;
data input;
};
item *items;
int capacity;
int size;
};
#endif // BST_H