src/Common/Abstracts/AbstractLinkedList.php
public function containsKey($key): bool {
        $node = $this->getHead();
        while (null !== $node) {
            if (Comparator::equals($node->getKey(), $key)) {
                return true;
            }
            $node = $node->getNext();
        }
        return false;
    }
public function containsKey($key): bool {
        $node = $this->getHead();
        while (null !== $node) {
            if (Comparator::equals($node->getKey(), $key)) {
                return true;
            }
            $node = $node->getNext();
        }
        return false;
    }
public function containsKey ( $ key ) : bool { $ node = $ this -> getHead ( ) ; while ( null !== $ node ) { if ( Comparator :: equals ( $ node -> getKey ( ) , $ key ) ) { return true ; } $ node = $ node -> getNext ( ) ; } return false ; }
searches the list for a given key

@param $key
@return bool
searches the list for a given key