You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For consistency, I should assert in all methods that accept "indices" that they are valid, i.e. by using something of the form assert self.is_good_index(my_index). Examples of functions that do not do that: _index_of_max, _index_of_min, etc.
Mare sure that this assertion is required in certain methods: it may happen that it's "ok" that in a call or recursive sub-call to a function the indices are no more valid!!!
Check also the cases for BinaryHeap, MinHeap and MaxHeap.
The text was updated successfully, but these errors were encountered:
False positive: those functions are already checking their indices when they call other functions at the beginning of their body which actually explicitly call assert self.is_good_index(my_index).
For consistency, I should assert in all methods that accept "indices" that they are valid, i.e. by using something of the form
assert self.is_good_index(my_index)
. Examples of functions that do not do that:_index_of_max
,_index_of_min
, etc.Mare sure that this assertion is required in certain methods: it may happen that it's "ok" that in a call or recursive sub-call to a function the indices are no more valid!!!
Check also the cases for
BinaryHeap
,MinHeap
andMaxHeap
.The text was updated successfully, but these errors were encountered: