diff --git a/bintree.c b/bintree.c index 951aaef..83f25ab 100644 --- a/bintree.c +++ b/bintree.c @@ -87,12 +87,8 @@ TreeNode *addToTreeRec(TreeNode *currentNode, TreeNode *newNode, CompareFctType *isDuplicate = 1; } } - /* - if (isDuplicate != NULL) - { - *isDuplicate = 0; - } - */ + + return currentNode; } @@ -111,13 +107,14 @@ void *nextTreeData(TreeNode *root) { // Add tree to stack so that bigest entry is ontop stackRoot = nextTreeDataRec(root, stackRoot); - pointerToReturn = stackRoot; + pointerToReturn = top(stackRoot); } else { // return current top entry and then pop that top entry - pointerToReturn = top(stackRoot); stackRoot = pop(stackRoot); + pointerToReturn = top(stackRoot); + } diff --git a/bintree.o b/bintree.o index 704a339..227f610 100644 Binary files a/bintree.o and b/bintree.o differ diff --git a/doble.exe b/doble.exe index 1bd7443..3890cd9 100644 Binary files a/doble.exe and b/doble.exe differ diff --git a/highscore.o b/highscore.o index 77510dc..4bb6e8e 100644 Binary files a/highscore.o and b/highscore.o differ