in C write an algorithm to count the nodes in a linked list

in C++, write an algorithm to count the nodes in a linked list with first node pointed to by first

Solution

Answer:

The algorithm to count the nodes in a linked list with first node pointed to by first is given as below :

void count()
{
struct node *support;
int size = 0;
support = first;
while(support!=NULL)
{
size++;
support=support->next;
}
cout<<\"Number of nodes of Linked List is :\"<<size;
}

in C++, write an algorithm to count the nodes in a linked list with first node pointed to by firstSolutionAnswer: The algorithm to count the nodes in a linked l

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site