Link to home
Start Free TrialLog in
Avatar of kellyjj
kellyjj

asked on

going to the begging of a linked list( the head node)

How do I go to the Head node in a linked list?  
I would need to do this when scaning and I want/need to scan from the begging.
Avatar of rmichels
rmichels

not really sure if I have enuf information to answer you.  Usually when you have a linked list, you maintain a variable that points to the head (a pointer).  That way you can always reference the head.  Another method is that liked lists can have double links, that is each link points to it's sucessor and predecessor.  Working backwards thru the list,you stop when the predecessor is 0/null indicating the beginning of the list

ASKER CERTIFIED SOLUTION
Avatar of bradz
bradz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial