File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
src/Advanced.Algorithms/DataStructures/Tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ private RedBlackTreeNode<T> find(T value)
146146 public int Insert ( T value )
147147 {
148148 var node = InsertAndReturnNode ( value ) ;
149- return node . Position ;
149+ return Root . Position ( value ) ;
150150 }
151151
152152 /// <summary>
@@ -361,7 +361,7 @@ public int Delete(T value)
361361 return - 1 ;
362362 }
363363
364- var position = node . Position ;
364+ var position = Root . Position ( value ) ;
365365
366366 delete ( node ) ;
367367
Original file line number Diff line number Diff line change @@ -10,9 +10,6 @@ internal abstract class BSTNodeBase<T> where T : IComparable
1010 //Used to fasten kth smallest computation.
1111 internal int Count { get ; set ; } = 1 ;
1212
13- //position of this node in sorted order of containing BST
14- internal int Position => Left == null ? 0 : Left . Count ;
15-
1613 internal virtual BSTNodeBase < T > Parent { get ; set ; }
1714
1815 internal virtual BSTNodeBase < T > Left { get ; set ; }
You can’t perform that action at this time.
0 commit comments