test2.cc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "source2.h"
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. Triehard2 * test = new Triehard2();
  7. cout << "success! Created test" << endl;
  8. int x[3] = {0,1,0};
  9. int y[5] = {1,0,1,1,0};
  10. int z[1] = {0};
  11. int a[7] = {1,0,1,1,0,0,0};
  12. int b[7] = {0,1,1,0,0,1,1};
  13. cout << "Search result for searching 010: " << test->search(x, 3) << endl;
  14. test->insert(x, 3);
  15. cout << "success! inserted x" << endl;
  16. test->insert(a, 7);
  17. cout << "success! inserted a" << endl;
  18. test->insert(y, 5);
  19. cout << "success! inserted y" << endl;
  20. test->insert(y, 5);
  21. cout << "success! inserted y" << endl;
  22. test->insert(y, 5);
  23. cout << "success! inserted y" << endl;
  24. test->insert(z, 1);
  25. cout << "success! inserted z" << endl;
  26. test->insert(b, 7);
  27. cout << "success! inserted b" << endl;
  28. test->myPrintIsBetterThanYoursLogan();
  29. cout << "Print Done!" << endl;
  30. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  31. test->cut(y, 5);
  32. cout << "success! cut y" << endl;
  33. test->myPrintIsBetterThanYoursLogan();
  34. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  35. test->cut(y, 5);
  36. cout << "success! cut y" << endl;
  37. test->cut(y, 5);
  38. cout << "success! cut y" << endl;
  39. test->myPrintIsBetterThanYoursLogan();
  40. cout << "Search result for 10110: " << test->search(y, 5) << endl;
  41. delete test;
  42. cout << "success! Completed test" << endl;
  43. //while(1);
  44. }