Homework/HW02/List.cc
bool List::removeFront()
{
    bool operationSuccessful = false;

    //Make sure the list is not empty.
    if (size)
    {
        //Store the current head of the list so it doesn't get lost.
        ListNode *temp = head;

        //Point the head of the list at the next node.
        head = head->next;

        //Delete the former head node of the list.
        delete temp;

        //Decrement the size.
        --size;

        //If the new size is 0, then we just deleted the last node in the list and need to update
        //tail to reflect that fact.
        if (!size)
            tail = NULL;

        //Operation was successful.
        operationSuccessful = true;
    }

    return operationSuccessful;
}
/****************************** List::removeFront **************************************************
Action:         Removes the front node from the list and then delets said node.  Returns true if the
                operation was successful, and false if it was not (e.g. the list was already empty).
                This function also updates the head, tail, and size attributes as necessary.

Parameters:
IN:             None
OUT:            None

Returns:        bool, indicating whether the operation was successful or not.

Precondition:   None
***************************************************************************************************/
:removeFront
Action:         Removes the front node from the list and then delets said node.  Returns true if the
operation was successful, and false if it was not .
This function also updates the head, tail, and size attributes as necessary.

None
OUT:            None

bool, indicating whether the operation was successful or not.

None
: removeFront Action : Removes the front node from the list and then delets said node . Returns true if the operation was successful and false if it was not . This function also updates the head tail and size attributes as necessary . None OUT : None bool indicating whether the operation was successful or not . None
bool List::removeFront()
{
    bool operationSuccessful = false;
    if (size)
    {
        ListNode *temp = head;
        head = head->next;
        delete temp;
        --size;
        if (!size)
            tail = NULL;
        operationSuccessful = true;
    }
    return operationSuccessful;
}
bool List :: removeFront ( ) { bool operationSuccessful = false ; if ( size ) { ListNode * temp = head ; head = head -> next ; delete temp ; -- size ; if ( ! size ) tail = NULL ; operationSuccessful = true ; } return operationSuccessful ; }
List::removeFront
Action:         Removes the front node from the list and then delets said node.
List :: removeFront Action : Removes the front node from the list and then delets said node .
//Make sure the list is not empty. //Store the current head of the list so it doesn't get lost. //Point the head of the list at the next node. //Delete the former head node of the list. //Decrement the size. //If the new size is 0, then we just deleted the last node in the list and need to update //tail to reflect that fact. //Operation was successful.