-
Notifications
You must be signed in to change notification settings - Fork 38
/
BPlusTree.h
36 lines (33 loc) · 1.24 KB
/
BPlusTree.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
#pragma once
#include "struct.h"
#include "Tree.h"
class BPlusTree :
public Tree
{
protected:
virtual btree_node* btree_create();
virtual btree_node* btree_node_new();
virtual int btree_split_child(btree_node *parent, int pos, btree_node *child);
virtual void btree_insert_nonfull(btree_node *node, int target);
virtual void btree_merge_child(btree_node *root, int pos, btree_node *y, btree_node *z);
virtual void btree_delete_nonone(btree_node *root, int target);
virtual int btree_search_successor(btree_node *root);
virtual int btree_search_predecessor(btree_node *root);
virtual void btree_shift_to_left_child(btree_node *root, int pos, btree_node *y, btree_node *z);
virtual void btree_shift_to_right_child(btree_node *root, int pos, btree_node *y, btree_node *z);
virtual btree_node* btree_insert(btree_node *root, int target);
virtual btree_node *btree_delete(btree_node *root, int target);
virtual void btree_inorder_print(btree_node *root);
virtual void btree_level_display(btree_node *root);
virtual void Save(btree_node *root);
/**
* @brief print tree linearly using prev/next pointer
*
* @param root: root of tree
*/
void btree_linear_print(btree_node *root);
public:
BPlusTree(void);
~BPlusTree(void);
void linear_print();
};