• + 8 comments
    int CompareLists(Node *h1, Node *h2) {
        while (h1 && h2 && (h1->data == h2->data)) {
            h1 = h1->next;
            h2 = h2->next;
        }
        return h1 == h2;
    }