Skip to content

Instantly share code, notes, and snippets.

@meetkool
Last active February 21, 2026 06:24
Show Gist options
  • Select an option

  • Save meetkool/fa71d1132c66e1b8d515a73c4c50b76c to your computer and use it in GitHub Desktop.

Select an option

Save meetkool/fa71d1132c66e1b8d515a73c4c50b76c to your computer and use it in GitHub Desktop.
[BLOG] cnt no of elements in the linkedlist
title date excerpt tags privacy
cnt no of elements in the linkedlist
2026-02-21
```
[blog,quick-post]
public
    Node* temp3 = head;
    int cnt=0;
    while(temp3 != nullptr){
        cnt++;
        temp3 = temp3 -> next;
    }
    cout<<cnt<<endl;
    // return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment