Can someone please tell what is the code for checking the size of a linked list(number of nodes).This is what my code is(inserting nd deleting head + printing info of all nodes)
struct node
{
int info;
node *nextptr;
};
class list
{
private:
node *L,*tail;
int count;
public:
list()
{
L=tail=NULL;
count=0;
}
void InsertHead(int info);
int RemoveHead();
void Print();
};