-
Notifications
You must be signed in to change notification settings - Fork 0
/
LeafNode.h
50 lines (38 loc) · 919 Bytes
/
LeafNode.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
46
47
48
49
50
/**
@file LeafNode.h
@brief LeafNode class
@author Brandon Theisen, Jason Pederson, Kelvin Shultz, Chris, Jared
*/
#ifndef _LEAF_NODE
#define _LEAF_NODE
#include <vector>
#include "Node.h"
using namespace std;
template<class T>
class LeafNode : public Node<T>
{
public:
LeafNode();
LeafNode(int cap);
//Copy Constructor
LeafNode(const Node<T>& newCopy);
//ADD KEY
int addKey(int newKey);
//GET CHILD
Node<T>* getChild(int key);
//SET CHILD
void setChild(Node<T>* newChild, int position);
//SPLIT
void split(Node<T>* &newNodePtr);
//MERGE
void mergeNodes(Node<T>* &otherNodePtr);
virtual ~LeafNode();
//These functions are implemented in Node.h
int getSize();
Node<T>* getParent();
void setParent(Node<T>* newParentPtr);
int getKeyAt(int position);
bool contains(int key);
};
#include "LeafNode.cpp"
#endif // _Leaf_NODE