What's Linked List & Implementation?

Length of LL
int getLength(Node* head) {
    int count = 0;
    while(head != NULL) {
        count++;
        head = head->next;
    }
    return count;
}

Last updated

Was this helpful?