summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas <Jonas@Jonas-PC> 2017-02-11 13:10:52 +0100
committerGravatar Jonas <Jonas@Jonas-PC> 2017-02-11 13:10:52 +0100
commitc2b06e76f7fdbaac8589048b416a74d19484387a (patch)
treebcc77caa657de4751db8d22eccc888f330966d83
parentc7e1a088c886a36f4164d0bbd968bb1338963c9e (diff)
downloadtree-c2b06e76f7fdbaac8589048b416a74d19484387a.tar.gz
*performance and stability test in main.cpp
-rw-r--r--tree/.settings/language.settings.xml4
-rw-r--r--tree/src/main.cpp31
2 files changed, 21 insertions, 14 deletions
diff --git a/tree/.settings/language.settings.xml b/tree/.settings/language.settings.xml
index 16f6114..afdea9b 100644
--- a/tree/.settings/language.settings.xml
+++ b/tree/.settings/language.settings.xml
@@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
- <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-101796686550714506" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+ <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-750291126613751836" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
- <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-101796686550714506" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+ <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-750291126613751836" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
diff --git a/tree/src/main.cpp b/tree/src/main.cpp
index 869ccb1..3e7b795 100644
--- a/tree/src/main.cpp
+++ b/tree/src/main.cpp
@@ -15,27 +15,34 @@ int main (void)
{
cTree* a = new cTree();
- for (char b = ' '; b <= '~'; b++)
+ cout << "Filling with data..." << endl;
+ for (char b = ' '; b <= '~'; b++) //insert some data into tree
{
- stringstream ss;
- string y;
-
- ss << b;
- ss >> y;
+ for(char c = ' '; c<= '~'; c++)
+ {
+ stringstream ss;
+ ss << b;
+ ss << c;
- a->insert(y);
+ a->insert(ss.str());
+ }
}
- a->draw();
- cout << "-------------------" << endl;
+ //a->draw();
+ cout << "size: "<< a->size() << endl << "Unbalance: " << a->gradeOfUnbalance() << endl << "Depth: " << a->depth() << endl;
+
+ cout << "Balancing..." << endl;
a->sort();
- a->draw();
+ cout << "size: "<< a->size() << endl << "Unbalance: " << a->gradeOfUnbalance() << endl << "Depth: " << a->depth() << endl;
+ //a->draw();
+ cout << "-------------------" << endl;
+ //a->draw();
- for(unsigned int i = 0; i < a->size(); i++)
+ /*for(unsigned int i = 0; i < a->size(); i++)
{
cout << (*a)[i]->getData() << ", ";
}
- cout << endl;
+ cout << endl;*/
/*while(1)