Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- using namespace std;
- struct Osoba{
- string imie, nazwisko;
- int rok_urodzenia;
- char plec;
- };
- struct TreeNode{
- Osoba *data;
- TreeNode *left_child;
- TreeNode *right_child;
- TreeNode *parent;
- };
- class binaryTree{
- private:
- TreeNode *root; //korzen
- public:
- binaryTree();
- ~binaryTree();
- bool add_root(Osoba *o);
- bool add_left_child(Osoba *o, TreeNode *parent);
- bool add_right_child(Osoba *o, TreeNode *parent);
- bool modify(TreeNode *n, string imie, string nazwisko, int rok);
- void delete_leaf(TreeNode *n);
- void delete_node(TreeNode *n);
- void make_null();
- TreeNode *find(string imie, string nazwisko);
- void print_root();
- void print_osoba(TreeNode *n);
- TreeNode *get_root();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement