contains method
Implementation
bool contains(T element) {
var currentNode = _head;
while (currentNode != null) {
if (currentNode.data == element) return true;
currentNode = currentNode.next;
}
return false;
}
bool contains(T element) {
var currentNode = _head;
while (currentNode != null) {
if (currentNode.data == element) return true;
currentNode = currentNode.next;
}
return false;
}