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
{{ message }}
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.
One of my users remarked that it was either wrong to use the Comparable or Comparator for methods involving equality tests in heaps, such as:
contains(),
removeAll(),
equals()
because indeed object equality is a different concept as object ordering, so that compareTo(obj) == 0 cannot be used in place of an object equals() when testing equality.
Consequently make so that the above methods for heaps use equals() instead of the comparison criteria as before.
Besides, that allows
contains(),
removeAll()
to be consistent with the other KTypeContainer implementations using equals().
The text was updated successfully, but these errors were encountered:
One of my users remarked that it was either wrong to use the
Comparable
orComparator
for methods involving equality tests in heaps, such as:contains()
,removeAll()
,equals()
because indeed object equality is a different concept as object ordering, so that
compareTo(obj) == 0
cannot be used in place of an objectequals()
when testing equality.Consequently make so that the above methods for heaps use
equals()
instead of the comparison criteria as before.Besides, that allows
contains()
,removeAll()
to be consistent with the other
KTypeContainer
implementations usingequals()
.The text was updated successfully, but these errors were encountered: