Skip to content

Commit 75ae63a

Browse files
committed
Making order of arguments more coherent.
1 parent 982b7c6 commit 75ae63a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

source/code/projects/Tree/Tree/BSTree.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public override bool Find(T dataP)
4040
bool found = false;
4141
if (root != null)
4242
{
43-
found = Find(root, dataP);
43+
found = Find(dataP, root);
4444
}
4545
return found;
4646
}
4747

48-
private bool Find(Node nodeP, T dataP)
48+
private bool Find(T dataP, Node nodeP)
4949
{
5050
bool found = false;
5151
if (nodeP != null)
@@ -58,11 +58,11 @@ private bool Find(Node nodeP, T dataP)
5858
{
5959
if (dataP.CompareTo(nodeP.Data) < 0) // dataP < nodeP.Data
6060
{
61-
found = Find(nodeP.left, dataP);
61+
found = Find(dataP, nodeP.left);
6262
}
6363
else if (dataP.CompareTo(nodeP.Data) > 0) // dataP > nodeP.Data
6464
{
65-
found = Find(nodeP.right, dataP);
65+
found = Find(dataP, nodeP.right);
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)