bool isPrefix(const Cell* A, const Cell* B) { if(A == NULL) return true; else if(B == NULL) return false; else if(A->item != B->item) return false; else return isPrefix(A->next, B->next); }