Thread: need some help on understanding and using Lists

  1. #1
    Registered User
    Join Date
    Sep 2009
    Location
    california
    Posts
    8

    need some help on understanding and using Lists

    k so i have a project that I'm working on and i have to reset a list that i have created.
    i don't want to use any built in functions.

    i was thinking that i could jump to the top of the list and then deleting each item in the list then make the head (top of list) equal to NULL.

    I'm just not sure how to jump to the head of the list.

    thanks for the help.

  2. #2
    Registered User jdragyn's Avatar
    Join Date
    Sep 2009
    Posts
    96
    keep a pointer to the head of the list separate from whatever pointer you are using to traverse the list. Then set the traversing pointer equal to the head pointer to jump to the head. Just remember to update the pointer to the head of the list whenever the head of the list changes.

Popular pages Recent additions subscribe to a feed

Tags for this Thread

Website Security Test