fixed bug in nextTreeData()
This commit is contained in:
parent
c37ce6327c
commit
686fe8d844
13
bintree.c
13
bintree.c
@ -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
highscore.o
BIN
highscore.o
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user