-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbTree.h
More file actions
43 lines (41 loc) · 1.4 KB
/
Copy pathbTree.h
File metadata and controls
43 lines (41 loc) · 1.4 KB
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
#ifndef BTREE_H
#define BTREE_H
#include "buffer.h"
#include "bTreeNode.h"
class bTree
{
private:
string indexName;
indexType indtype;
unsigned int root;
unsigned int charLength;
std::vector<unsigned int> emptyBlock;
std::vector<unsigned int> findPath;
buffer* bm;
//test
//int blockCount;
//std::vector<BYTE*> blocks;
//test
public:
bTree(string name, buffer* bfm, indexType it, int length);
bTree(string name, indexType t, int length, buffer* bfm);
~bTree();
string getName();
bTreeNode findFirstNode(Index ind);
std::vector<unsigned int> findAll(Index ind);
std::vector<unsigned int> findGreater(Index ind, bool equal);
std::vector<unsigned int> findLess(Index ind, bool equal);
bTreeNode assignNode(unsigned int blockNo);
bTreeNode createNode(nodeType nt);
void freeNode(bTreeNode& node);
void insertIndex(Index ind);
void insertNode(unsigned int parent, unsigned int child, unsigned int pos, Index ind);
Index findMinIndex(bTreeNode& node);
void deleteIndex(Index ind);
void deleteNode(unsigned int parent, unsigned int path);
bTreeNode findBro(bTreeNode& node);
void cleanNode(bTreeNode& node);
void printTree();
void bfs(bTreeNode& b, std::vector<bTreeNode>& t);
};
#endif