File tree 3 files changed +0
-59
lines changed
src/Advanced.Algorithms/DataStructures/Tree
3 files changed +0
-59
lines changed Original file line number Diff line number Diff line change @@ -596,11 +596,6 @@ IEnumerator IEnumerable.GetEnumerator()
596
596
597
597
public IEnumerator < T > GetEnumerator ( )
598
598
{
599
- if ( nodeLookUp != null )
600
- {
601
- return new BSTNodeLookUpEnumerator < T > ( nodeLookUp ) ;
602
- }
603
-
604
599
return new BSTEnumerator < T > ( Root ) ;
605
600
}
606
601
}
Original file line number Diff line number Diff line change @@ -755,11 +755,6 @@ IEnumerator IEnumerable.GetEnumerator()
755
755
756
756
public IEnumerator < T > GetEnumerator ( )
757
757
{
758
- if ( nodeLookUp != null )
759
- {
760
- return new BSTNodeLookUpEnumerator < T > ( nodeLookUp ) ;
761
- }
762
-
763
758
return new BSTEnumerator < T > ( Root ) ;
764
759
}
765
760
}
Original file line number Diff line number Diff line change @@ -59,53 +59,4 @@ public void Dispose()
59
59
}
60
60
}
61
61
62
- // implement IEnumerator.
63
- internal class BSTNodeLookUpEnumerator < T > : IEnumerator < T > where T : IComparable
64
- {
65
- private readonly Dictionary < T , BSTNodeBase < T > > nodeLookUp ;
66
- private Dictionary < T , BSTNodeBase < T > > . Enumerator enumerator ;
67
- private T current ;
68
-
69
- internal BSTNodeLookUpEnumerator ( Dictionary < T , BSTNodeBase < T > > nodeLookUp )
70
- {
71
- this . nodeLookUp = nodeLookUp ;
72
- enumerator = nodeLookUp . GetEnumerator ( ) ;
73
- }
74
-
75
- public bool MoveNext ( )
76
- {
77
- if ( nodeLookUp == null )
78
- {
79
- return false ;
80
- }
81
-
82
- if ( enumerator . MoveNext ( ) )
83
- {
84
- current = enumerator . Current . Key ;
85
- return true ;
86
- }
87
-
88
- return false ;
89
- }
90
-
91
- public void Reset ( )
92
- {
93
- enumerator = nodeLookUp . GetEnumerator ( ) ;
94
- }
95
-
96
- public T Current
97
- {
98
- get
99
- {
100
- return current ;
101
- }
102
- }
103
-
104
- object IEnumerator . Current => Current ;
105
-
106
- public void Dispose ( )
107
- {
108
- enumerator . Dispose ( ) ;
109
- }
110
- }
111
62
}
You can’t perform that action at this time.
0 commit comments