Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Node.h"
- #include "Tree.h"
- using namespace std;
- int main()
- {
- // Now testing Default CTOR
- Tree *T;
- T= new Tree;
- // Now testing IsEmpty
- if (T->IsEmpty())
- cout<<"The root has no children"<<endl;
- else
- cout<<"The root has children"<<endl;
- //now testing DTOR
- delete T;
- // Now testing CTOR when root info is known
- T= new Tree("Is it and Animal?", "computer", "dog");
- // Now testing GetRoot
- Tree *right;
- right= T->RChild();
- cout<<"The root of this child is: "<< right->GetRoot()<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement