21 lines
405 B
C++
21 lines
405 B
C++
#include "bst.h"
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
bst b;
|
|
b.add(1);
|
|
cout << b.root->data << endl;
|
|
b.add(-1);
|
|
cout << b.root->left->data << endl;
|
|
//cout << b.root->right->data << endl;
|
|
b.add(4);
|
|
cout << b.root->right->data << endl;
|
|
b.add(5);
|
|
cout << b.root->right->right->data << endl;
|
|
b.remove(5);
|
|
cout << b.root->data << endl;
|
|
|
|
}
|