fixed bug in nextTreeData()

This commit is contained in:
Jonas Hofmann 2025-12-13 16:21:24 +01:00
parent c37ce6327c
commit 686fe8d844
4 changed files with 5 additions and 8 deletions

View File

@ -87,12 +87,8 @@ TreeNode *addToTreeRec(TreeNode *currentNode, TreeNode *newNode, CompareFctType
*isDuplicate = 1; *isDuplicate = 1;
} }
} }
/*
if (isDuplicate != NULL)
{
*isDuplicate = 0;
}
*/
return currentNode; return currentNode;
} }
@ -111,13 +107,14 @@ void *nextTreeData(TreeNode *root)
{ {
// Add tree to stack so that bigest entry is ontop // Add tree to stack so that bigest entry is ontop
stackRoot = nextTreeDataRec(root, stackRoot); stackRoot = nextTreeDataRec(root, stackRoot);
pointerToReturn = stackRoot; pointerToReturn = top(stackRoot);
} }
else else
{ {
// return current top entry and then pop that top entry // return current top entry and then pop that top entry
pointerToReturn = top(stackRoot);
stackRoot = pop(stackRoot); stackRoot = pop(stackRoot);
pointerToReturn = top(stackRoot);
} }

BIN
bintree.o

Binary file not shown.

BIN
doble.exe

Binary file not shown.

Binary file not shown.