test3.cc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "source3.h"
  2. #include <iostream>
  3. #include <vector>
  4. using namespace std;
  5. int main()
  6. {
  7. Triehard * test = new Triehard();
  8. cout << "success! Created test" << endl;
  9. vector<int> x = {1,2,3};
  10. vector<int> y = {5,7,7,7,5};
  11. vector<int> z = {5};
  12. vector<int> a = {5,7,7,8,9};
  13. vector<int> b = {1,2};
  14. cout << "Search result for searching 123: " << test->search(&x) << endl;
  15. test->insert(&x);
  16. cout << "success! inserted x" << endl;
  17. test->insert(&a);
  18. cout << "success! inserted a" << endl;
  19. test->insert(&y);
  20. cout << "success! inserted y" << endl;
  21. test->insert(&z);
  22. cout << "success! inserted z" << endl;
  23. test->insert(&b);
  24. cout << "success! inserted b" << endl;
  25. test->myPrintIsBetterThanYoursLogan();
  26. cout << "Print Done!" << endl;
  27. cout << "Search result for 57775: " << test->search(&y) << endl;
  28. cout << "Compression rate compared to a standard trie: " << test->compressionovertrie() << endl;
  29. cout << "Compression rate compared to a list of lists: " << test->compressionoverdict() << endl;
  30. test->cut(&y);
  31. cout << "success! cut y" << endl;
  32. test->myPrintIsBetterThanYoursLogan();
  33. cout << "Search result for 57775: " << test->search(&y) << endl;
  34. delete test;
  35. cout << "success! Completed test" << endl;
  36. //while(1);
  37. }