-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (29 loc) · 839 Bytes
/
main.cpp
File metadata and controls
40 lines (29 loc) · 839 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
39
40
#include <stdio.h>
#include "B+tree/B+tree.h"
#include <stdlib.h>
int main ( int argc, char *argv[] )
{
int t;
int temp;
int quantity;
int indx;
printf("Enter the minimum number of keys in a node (3 or more): ");
scanf( "%d", &t );
printf("Enter the quantity elements of tree: ");
scanf( "%d", &quantity );
struct Tree *myTree = initTree( t );
string *a = strCreate();
for ( int i = 0; i < quantity; i++ ){
scanf( "%d", &indx );
strScan( a, stdin );
insertKeyIntoTree( myTree, indx, a );
}
write( myTree );
printf( "Enter the index of the item that you want to remove: " );
scanf( "%d", &temp );
deleteKeyFromTree( myTree, temp );
write( myTree );
system("pause>>null");
destroyTree(myTree->root, myTree->level);
return 0;
}