ADT - destroyQueue; count vs null pointer

Discussion in 'C' started by Sorin, Sep 5, 2010.

  1. Sorin

    Sorin New Member

    Sep 5, 2010
    Likes Received:
    Trophy Points:
    When writing the destroyQueue function for my queue ADT, is there really that much of a difference in using

    as opposed to

    while(queue->front != NULL)
    for the control statement of the loop that steps through the queue and destroys it? Using the assumption that the rest of the code and functions are bug free, and that the queue counts and next pointers are working correctly to facilitate those conditions. I don't see a difference, but then, I'm just a student and may not be seeing some sort of subtle potential pitfall.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice