File tree 1 file changed +2
-2
lines changed
src/com/jwetherell/algorithms/data_structures
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public boolean add(T value) {
96
96
private NodeLevelPair <T > findPredecessor (T value ) {
97
97
Node <T > node = head ;
98
98
if (node ==null ) return null ;
99
- if (node .value .equals (value )) return null ;
99
+ if (node .value .compareTo (value )== 0 ) return null ;
100
100
101
101
// Current node is not the node we are looking for; Keep moving down
102
102
// until you find a node with a non-null "next" pointer.
@@ -283,7 +283,7 @@ public String getString(T value, int level) {
283
283
builder .append ("[" ).append (i ).append ("] " );
284
284
node = head ;
285
285
while (node != null ) {
286
- if (level ==i && value !=null && node .value .equals (value ))
286
+ if (level ==i && value !=null && node .value .compareTo (value )== 0 )
287
287
builder .append ("(" ).append (node .value ).append (")" );
288
288
else
289
289
builder .append (node .value );
You can’t perform that action at this time.
0 commit comments