mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
added Count to trees
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@3182 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -30,6 +30,7 @@ VOID PhInitializeBinaryTree(
|
||||
Tree->Root.Parent = NULL;
|
||||
Tree->Root.Left = NULL;
|
||||
Tree->Root.Right = NULL;
|
||||
Tree->Count = 0;
|
||||
Tree->CompareFunction = CompareFunction;
|
||||
}
|
||||
|
||||
@@ -113,6 +114,8 @@ PPH_BINARY_LINKS PhBinaryTreeAdd(
|
||||
Subject->Left = NULL;
|
||||
Subject->Right = NULL;
|
||||
|
||||
Tree->Count++;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -170,6 +173,8 @@ VOID PhBinaryTreeRemove(
|
||||
if (child->Right)
|
||||
child->Right->Parent = child;
|
||||
}
|
||||
|
||||
Tree->Count--;
|
||||
}
|
||||
|
||||
PPH_BINARY_LINKS PhBinaryTreeSearch(
|
||||
@@ -197,6 +202,8 @@ VOID PhInitializeAvlTree(
|
||||
Tree->Root.Left = NULL;
|
||||
Tree->Root.Right = NULL;
|
||||
Tree->Root.Balance = 0;
|
||||
Tree->Count = 0;
|
||||
|
||||
Tree->CompareFunction = CompareFunction;
|
||||
}
|
||||
|
||||
@@ -709,6 +716,8 @@ PPH_AVL_LINKS PhAvlTreeAdd(
|
||||
}
|
||||
}
|
||||
|
||||
Tree->Count++;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -829,6 +838,8 @@ VOID PhAvlTreeRemove(
|
||||
if (newSubject->Right)
|
||||
newSubject->Right->Parent = newSubject;
|
||||
}
|
||||
|
||||
Tree->Count--;
|
||||
}
|
||||
|
||||
PPH_AVL_LINKS PhAvlTreeSearch(
|
||||
|
||||
@@ -1810,6 +1810,8 @@ typedef INT (NTAPI *PPH_BINARY_TREE_COMPARE_FUNCTION)(
|
||||
typedef struct _PH_BINARY_TREE
|
||||
{
|
||||
PH_BINARY_LINKS Root; // Right contains real root
|
||||
ULONG Count;
|
||||
|
||||
PPH_BINARY_TREE_COMPARE_FUNCTION CompareFunction;
|
||||
} PH_BINARY_TREE, *PPH_BINARY_TREE;
|
||||
|
||||
@@ -1851,6 +1853,8 @@ typedef INT (NTAPI *PPH_AVL_TREE_COMPARE_FUNCTION)(
|
||||
typedef struct _PH_AVL_TREE
|
||||
{
|
||||
PH_AVL_LINKS Root; // Right contains real root
|
||||
ULONG Count;
|
||||
|
||||
PPH_AVL_TREE_COMPARE_FUNCTION CompareFunction;
|
||||
} PH_AVL_TREE, *PPH_AVL_TREE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user