contains method
Returns true if this queue contains the specified element.
Implementation
@override
bool contains(Object? element) {
var current = _head;
while (current != null) {
if (current.data == element) {
return true;
}
current = current.next;
}
return false;
}