Skip to content

Commit aa356a8

Browse files
Fix comments.
1 parent 2c4cc0b commit aa356a8

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

DataStructures/Trees/BinarySearchTreeNode.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-

2-
namespace DataStructures.Trees
1+
namespace DataStructures.Trees
32
{
43
/// <summary>
54
/// The binary search tree node.

DataStructures/Trees/RedBlackTree.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ protected bool _remove(RedBlackTreeNode<TKey> nodeToDelete)
465465
return false;
466466
}
467467

468-
// Node X moves to the original nodeToDelete position in the tree.
468+
// X it's node that will become move to original nodeToDelete position in the tree.
469469
RedBlackTreeNode<TKey> x;
470470

471471
if (nodeToDelete.HasOnlyRightChild)
@@ -480,7 +480,7 @@ protected bool _remove(RedBlackTreeNode<TKey> nodeToDelete)
480480
}
481481
else
482482
{
483-
// Node Y moves to the original node X position in the tree.
483+
// Y it's node that will become move to original X position in the tree.
484484
var y = (RedBlackTreeNode<TKey>)_findMinNode(nodeToDelete.RightChild);
485485
x = y.RightChild;
486486

@@ -523,7 +523,7 @@ protected bool _remove(RedBlackTreeNode<TKey> nodeToDelete)
523523
/// <summary>
524524
/// Insert one subtree in the place of the other in his parent.
525525
/// </summary>
526-
/// <param name="replaced">Subtree replaced by <param name="replacement">.</param></param>
526+
/// <param name="replaced">Subtree of node will be replaced by <param name="replacement">.</param></param>
527527
/// <param name="replacement">Subtree replaces <param name="replaced">.</param></param>
528528
private void Transplant(RedBlackTreeNode<TKey> replaced, RedBlackTreeNode<TKey> replacement)
529529
{

UnitTest/DataStructuresTests/RedBlackTreeTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public void Remove_CurrentRoot()
371371
[Fact]
372372
public void Remove_ThrowExceptionWhenTryRemoveNonExistentNode()
373373
{
374-
//TODO Create more specyfic exception type for this kind of errors.
374+
//TODO Create more specyfic exception type for this kind of errors, with inheritance from ArgumentException.
375375
Assert.Throws<Exception>(() =>redBlackTree.Remove(999));
376376
}
377377
}

0 commit comments

Comments
 (0)