int getLength(Node* head) { int count = 0; while(head != NULL) { count++; head = head->next; } return count; }
Last updated 6 months ago
Was this helpful?