Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 1st, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. how to find the size of a LINKED LIST (data structure) in c language?
  2. Here is how the function will look like.
  3.  
  4. int size(Node *head)
  5.     {
  6.         int len = 0;
  7.         while(head != null)
  8.         {
  9.            len++;
  10.            head = head->next;
  11.  
  12.         }
  13.        return len;
  14.     }