Q:
Calculate length of the linked list
A:
public int getLength(Node head)
{
if (head == null)
return 0;
else
return length(head.next) + 1;
}
Thursday, April 22, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment