summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas <Jonas@Jonas-PC> 2017-02-12 18:01:44 +0100
committerGravatar Jonas <Jonas@Jonas-PC> 2017-02-12 18:01:44 +0100
commit209baf965284e5ea064afff76d087916af25fcf1 (patch)
treeb46ec48d7b2fbe76afb8cfc1975defbc02e164d6
parentc2b06e76f7fdbaac8589048b416a74d19484387a (diff)
downloadtree-209baf965284e5ea064afff76d087916af25fcf1.tar.gz
comments + testing stuff in main.cpp
-rw-r--r--tree/.cproject2
-rw-r--r--tree/.settings/language.settings.xml4
-rw-r--r--tree/src/cNode.cpp5
-rw-r--r--tree/src/cNode.h1
-rw-r--r--tree/src/cTree.h1
-rw-r--r--tree/src/main.cpp8
6 files changed, 13 insertions, 8 deletions
diff --git a/tree/.cproject b/tree/.cproject
index 6aa220f..c292841 100644
--- a/tree/.cproject
+++ b/tree/.cproject
@@ -16,7 +16,7 @@
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.992883527." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.1750761033" name="Cross GCC" nonInternalBuilderId="cdt.managedbuild.builder.gnu.cross" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1864634322" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
- <builder autoBuildTarget="all" buildPath="${workspace_loc:/tree}/Debug" cleanBuildTarget="clean" id="org.eclipse.cdt.build.core.internal.builder.861651851" incrementalBuildTarget="all" managedBuildOn="true" name="CDT Internal Builder" superClass="org.eclipse.cdt.build.core.internal.builder"/>
+ <builder autoBuildTarget="all" buildPath="${workspace_loc:/tree}/Debug" cleanBuildTarget="clean" id="org.eclipse.cdt.build.core.internal.builder.861651851" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.internal.builder"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1925147654" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1319784671" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.649809700" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
diff --git a/tree/.settings/language.settings.xml b/tree/.settings/language.settings.xml
index afdea9b..4200ffe 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="-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">
+ <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-526476468772666232" 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="-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">
+ <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-526476468772666232" 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/cNode.cpp b/tree/src/cNode.cpp
index 95b6c45..b2c4d36 100644
--- a/tree/src/cNode.cpp
+++ b/tree/src/cNode.cpp
@@ -116,12 +116,13 @@ unsigned int cDatanode::getSubtreeSize()
{
return nextSmaller->getSubtreeSize() + nextBigger->getSubtreeSize() + 1;
}//getSubtreeSize
+
//
//==============================================================================================================================
//
-cEndnode::cEndnode() {}
-cEndnode::~cEndnode() {}
+cEndnode::cEndnode() { }
+cEndnode::~cEndnode() { }
cData cEndnode::getDataObject()
{
diff --git a/tree/src/cNode.h b/tree/src/cNode.h
index 8bbc915..b3ec3ef 100644
--- a/tree/src/cNode.h
+++ b/tree/src/cNode.h
@@ -101,6 +101,7 @@ private:
class cEndnode:public cNode
{
public:
+ //TODO Optimize! there are 2^(n+1) endnodes in a tree wich each take 4B!
cEndnode();
~cEndnode();
diff --git a/tree/src/cTree.h b/tree/src/cTree.h
index 5bd3df8..b883576 100644
--- a/tree/src/cTree.h
+++ b/tree/src/cTree.h
@@ -30,6 +30,7 @@ public:
void insertList(list<cData>*);
/*
* inserts List into tree as balanced as possible
+ * assumes ordered list!
*/
void getList(list<cData>*);
/*
diff --git a/tree/src/main.cpp b/tree/src/main.cpp
index 3e7b795..d4c5ed3 100644
--- a/tree/src/main.cpp
+++ b/tree/src/main.cpp
@@ -30,13 +30,15 @@ int main (void)
//a->draw();
cout << "size: "<< a->size() << endl << "Unbalance: " << a->gradeOfUnbalance() << endl << "Depth: " << a->depth() << endl;
-
+ cout << "deleting element" << endl;
+ a->remove((*a)[100]);
cout << "Balancing..." << endl;
+ a->draw();
a->sort();
cout << "size: "<< a->size() << endl << "Unbalance: " << a->gradeOfUnbalance() << endl << "Depth: " << a->depth() << endl;
- //a->draw();
+ //
cout << "-------------------" << endl;
- //a->draw();
+ a->draw();
/*for(unsigned int i = 0; i < a->size(); i++)
{