Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include "BinaryTree.h"
  2.  
  3. int main() {
  4.  
  5.     BinaryTree<int> test;
  6.  
  7.     test.addElement("", 1);
  8.     test.addElement("L", 2);
  9.     test.addElement("R", 3);
  10.     test.addElement("LL", 4);
  11.     test.addElement("LR", 5);
  12.     test.addElement("LLL", 8);
  13.     test.addElement("LLR", 9);
  14.     test.addElement("LRL", 10);
  15.     test.addElement("LRR", 11);
  16.     test.addElement("RL", 6);
  17.     test.addElement("RR", 7);
  18.     test.addElement("RLL", 12);
  19.     test.addElement("RLR", 13);
  20.     test.addElement("RRL", 14);
  21.     test.addElement("RRR", 15);
  22.     test.addLeft(111);
  23.     test.addRight(888);
  24.  
  25.     test.prettyPrint(cout);
  26.  
  27.     cout << "\n\n";
  28.  
  29.     cout << test.member(16) << endl;
  30.     cout << test.sum() << endl;
  31.     cout << test.getSize() << endl;
  32.    
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement