Computer Science, asked by rudra9t2king, 4 days ago

Write an algorithm to count the no of nodes in the singly linked list​

Answers

Answered by amitbiswal660
1

❥︎ANSWER

  • Write an algorithm to count the no of nodes in the singly linked list.
  • Define a node current which will initially point to the head of the list.
  • Declare and initialize a variable count to 0.
  • Traverse through the list till current point to null.
  • Increment the value of count by 1 for each node encountered in the list.

❥︎THANKS

I hope it will help you.

Similar questions