daily pastebin goal
45%
SHARE
TWEET

lab3zad2Drzewo

michalkowalczyk Mar 19th, 2019 67 in 328 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include<functions.cpp>
  3.  
  4. int main()
  5. {
  6.     std::unique_ptr<node> head;
  7.  
  8.     //Build a tree
  9.     head = InsertNode(std::move(head),10);
  10.     head = InsertNode(std::move(head),2);
  11.     head = InsertNode(std::move(head),4);
  12.     head = InsertNode(std::move(head),12);
  13.     head = InsertNode(std::move(head),11);
  14.     head = InsertNode(std::move(head),7);
  15.     head = InsertNode(std::move(head),15);
  16.     head = InsertNode(std::move(head),14);
  17.     head = InsertNode(std::move(head),8);
  18.     head = InsertNode(std::move(head),1);
  19.  
  20.  
  21.  
  22.  
  23.     //Printing tree in different ways
  24.     std::cout<<"Inorder"<<std::endl;
  25.     PrintTreeInOrder(head);
  26.  
  27.     std::cout<<std::endl<<"Preorder"<<std::endl;
  28.     PrintTreePreOrder(head);
  29.  
  30.     std::cout<<std::endl<<"Postorder"<<std::endl;
  31.     PrintTreePostOrder(head);
  32.  
  33.     std::cout<<std::endl;
  34.  
  35.     //Destroying tree
  36.     std::string destroyedTree = DumpTree(head);
  37.     std::cout<<destroyedTree<<std::endl;
  38.  
  39.  
  40.     return 0;
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top