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