File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
UnitTest/DataStructuresTests Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
-
2
- namespace DataStructures . Trees
1
+ namespace DataStructures . Trees
3
2
{
4
3
/// <summary>
5
4
/// The binary search tree node.
Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ protected bool _remove(RedBlackTreeNode<TKey> nodeToDelete)
465
465
return false ;
466
466
}
467
467
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.
469
469
RedBlackTreeNode < TKey > x ;
470
470
471
471
if ( nodeToDelete . HasOnlyRightChild )
@@ -480,7 +480,7 @@ protected bool _remove(RedBlackTreeNode<TKey> nodeToDelete)
480
480
}
481
481
else
482
482
{
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.
484
484
var y = ( RedBlackTreeNode < TKey > ) _findMinNode ( nodeToDelete . RightChild ) ;
485
485
x = y . RightChild ;
486
486
@@ -523,7 +523,7 @@ protected bool _remove(RedBlackTreeNode<TKey> nodeToDelete)
523
523
/// <summary>
524
524
/// Insert one subtree in the place of the other in his parent.
525
525
/// </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>
527
527
/// <param name="replacement">Subtree replaces <param name="replaced">.</param></param>
528
528
private void Transplant ( RedBlackTreeNode < TKey > replaced , RedBlackTreeNode < TKey > replacement )
529
529
{
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ public void Remove_CurrentRoot()
371
371
[ Fact ]
372
372
public void Remove_ThrowExceptionWhenTryRemoveNonExistentNode ( )
373
373
{
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 .
375
375
Assert . Throws < Exception > ( ( ) => redBlackTree . Remove ( 999 ) ) ;
376
376
}
377
377
}
You can’t perform that action at this time.
0 commit comments