diff options
-rw-r--r-- | tree/.settings/language.settings.xml | 4 | ||||
-rw-r--r-- | tree/src/main.cpp | 31 |
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 "${INPUTS}"" 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 "${INPUTS}"" 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 "${INPUTS}"" 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 "${INPUTS}"" 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) |