File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,12 @@ var MaxHeap = /** @class */ (function () {
178
178
index = Math . floor ( ( index - 1 ) / 2 ) ;
179
179
other = Math . floor ( ( index - 1 ) / 2 ) ;
180
180
}
181
+ if ( index !== 0 ) {
182
+ control . highlightNode ( index , "green" ) ;
183
+ control . highlightNode ( other , "green" ) ;
184
+ control . removeHighlight ( index ) ;
185
+ control . removeHighlight ( other ) ;
186
+ }
181
187
} ;
182
188
MaxHeap . prototype . getName = function ( ) {
183
189
return this . name ;
Original file line number Diff line number Diff line change @@ -207,6 +207,13 @@ class MaxHeap implements IAlgorithm {
207
207
index = Math . floor ( ( index - 1 ) / 2 ) ;
208
208
other = Math . floor ( ( index - 1 ) / 2 ) ;
209
209
}
210
+
211
+ if ( index !== 0 ) {
212
+ control . highlightNode ( index , "green" ) ;
213
+ control . highlightNode ( other , "green" ) ;
214
+ control . removeHighlight ( index ) ;
215
+ control . removeHighlight ( other ) ;
216
+ }
210
217
}
211
218
212
219
getName ( ) : string {
You can’t perform that action at this time.
0 commit comments