Skip to content
Snippets Groups Projects
Select Git revision
  • Product/1555-readOnlyResources
  • master default protected
  • gitkeep
  • dev protected
  • Issue/2583-treeBug
  • Hotfix/2504-formGen
  • Issue/2309-docs
  • Issue/2462-removeTraces
  • Hotfix/2459-EncodingPath
  • Hotfix/2452-linkedDeletion
  • Issue/1792-newMetadataStructure
  • Hotfix/2384-guestsAndLinked
  • v2.8.14-Hotfix2365
  • Hotfix/2365-targetClassWorks
  • Hotfix/2371-fixGitLabinRCV
  • Fix/xxxx-activateGitlab
  • Test/xxxx-enablingGitLab
  • Issue/2349-gitlabHttps
  • Issue/2287-guestRole
  • Hotfix/2296-selectedValuesNotReturned
  • Issue/2102-gitLabResTypeRCV
  • v2.11.5
  • v2.11.4
  • v2.11.3
  • v2.11.2
  • v2.11.1
  • v2.11.0
  • v2.10.3
  • v2.10.2
  • v2.10.1
  • v2.10.0
  • v2.9.4
  • v2.9.3
  • v2.9.2
  • v2.9.1
  • v2.9.0
  • v2.8.16
  • v2.8.15
  • v2.8.14
  • v2.8.13
  • v2.8.12
41 results

README.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    tree_test.cpp 1.07 KiB
    #include "biased_binary_tree.h"
    #include <vector>
    #include <iostream>
    
    int main(){
      BiasedBinaryTree<int> start (std::make_shared<BiasedBinaryNode<int>>(5));
      for(int i = 1; i < 5; i++){
        std::cout << "joining " << i << std::endl;
        start.join(BiasedBinaryTree(std::make_shared<BiasedBinaryNode<int>>(2)));
      }
      BiasedBinaryTree<int> second (std::make_shared<BiasedBinaryNode<int>>(5));
      std::shared_ptr<BiasedBinaryNode<int>> split_pos = second.root();
      for(int i = 1; i < 5; i++){
        std::cout << "joining " << i << std::endl;
        second.join(BiasedBinaryTree(std::make_shared<BiasedBinaryNode<int>>(i)));
      }
      start.join(second);
      std::cout << "----------------" << std::endl;
      std::cout << start;
      BiasedBinaryTree<int> before;
      BiasedBinaryTree<int> after;
      std::cout << "-.-.-.-" << std::endl;
      std::cout << "use_count : " << split_pos.use_count() << std::endl;
      start.split_at(split_pos, before, after);
      std::cout << "----------------" << std::endl;
      std::cout << before;
      std::cout << "----------------" << std::endl;
      std::cout << after;
      std::cout << split_pos;
    }