diff options
author | jonas <himself@jonasgunz.de> | 2017-03-01 22:30:19 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2017-03-01 22:30:19 +0100 |
commit | f3f0cbdb5b50c81f4d9f089f576df7b26faeeef0 (patch) | |
tree | 5d3aa5865046a3b43b45d76c223c741c97f59a1c | |
parent | e6aa448a5710d88300f424080201018dfa711022 (diff) | |
parent | f120e158671eac73b653108cb0700ccf609fdf64 (diff) | |
download | tree-f3f0cbdb5b50c81f4d9f089f576df7b26faeeef0.tar.gz |
Merge branch 'master' into newDelete
-rw-r--r-- | tree/src/main.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/tree/src/main.cpp b/tree/src/main.cpp index 55709ff..658f4be 100644 --- a/tree/src/main.cpp +++ b/tree/src/main.cpp @@ -16,12 +16,14 @@ cTree* a; void fill(void); +void stress(void); + int main (void) { a = new cTree(); - int i; - int iInputOption; - string s; + int i; //Argument Integer + int iInputOption; //Input Selection + string s; //Argument String cout << endl; cout << "| |" << endl; @@ -42,6 +44,7 @@ int main (void) cout << "[6] Insert\n"; cout << "[7] Remove\n"; cout << "[8] Get by Inorder ID\n"; + cout << "[9] Stresstest\n"; cout << "[0] Exit\n"; cout << "> "; @@ -49,6 +52,9 @@ int main (void) switch(iInputOption) { + case 0: //fill + return 0; + break; case 1: //fill cout << "Filling with Data....."; fill(); @@ -81,6 +87,10 @@ int main (void) cin >> i; cout << i << ": " << (*a)[i]->getData() << endl; break; + case 9: + cout << "Started Stress-Loop. Stop with Ctrl+C\n"; + stress(); + break; default: cout << "Unrecognized Command\n"; break; @@ -107,4 +117,15 @@ void fill(void) } - +void stress(void) +{ + while(1) + { + fill(); + a->sort(); + for(int i = 0; i < a->size(); i++) + { + a->remove((*a)[i]); + } + } +} |