-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.h
More file actions
37 lines (34 loc) · 853 Bytes
/
node.h
File metadata and controls
37 lines (34 loc) · 853 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
#include <string>
const int CHILD_MIN = 7;
const int CHILD_MAX = 13;
const int MAXN = 1e4;
class BTNode;
class Node{
public:
long long data;
Node* nextField;
BTNode* self;
};
class BTNode {
public:
BTNode(std::string, BTNode*); //int cID, BTNode* par
void addNodeByIndex(Node*, int); // SOLELY IN THIS BTNode
int addNode(Node*);
void delNode(int); // SOLELY IN THIS BTNode
void setChild(BTNode*, int);
void setParent(BTNode*);
void setKey(Node*, int);
//void BTNode::setParentIndex(int);
int size();
//int index();
Node* getKey(int);
BTNode* getChild(int);
BTNode* getParent();
private:
Node* keys[CHILD_MAX + 2];
BTNode* children[CHILD_MAX + 2];
//int parentIndex; //index of the this node among its parent
BTNode* parent;
int sizee;
std::string columnName;
};