mode method
Returns the element(s) with the most occurrences.
1, 1, 2, 2, 3.mode() returns 1, 2.
[].mode() returns [].
Default h.symmetricDeepEquals compares DeepCollectionEquality().equals in both directions
to count occurrences since it is normally asymmetric.
Custom equalityFunction can be used which compares earlier elements to later elements.
Implementation
Queue<E> mode({
bool Function(E a, E b) equalityFunction = h.symmetricDeepEquals,
}) {
return h
.modeIterable(
original: this,
equalityFunction: equalityFunction,
)
.toQueue();
}