If my programming tutor knows it, i would not have asked for it in
this newsgroup, wasting u people's precious time.
Please let me know "How to find out the number of nodes in the list
without traversing ?", I ask again, because you said,"Yes."
The question was already answered. Take the time to read the responses.
I don't know of any way to do it without traversing the list, however, you
could actually keep count of inserted and deleted nodes. The count would
get out of whack if you have a bad algorithm for insertion, or deletion, and
end up with orphan nodes, but this would certainly suffice, infact, its
quite possible to keep a count in the head of the list and leave that
variable unused in the rest of the nodes, although thats wasteful
(sizeof(int) * # nodes - sizeof(int) wasteful to be exact.)
-- The Dragon
MHM 7x9, Hits you harder than a 2x4.