Homework/HW02/List.cc
void List::insertAfter(ListIterator chosenNode, int number)
{
    //If the iterator is NULL, insert at the head of the list.
    if (!chosenNode)
        insertFront(number);
    
    //If the iterator is not null, insert where it points.
    else
    {
        //Allocate memory for a new List Node and check it for validity.
        ListNode *newNode = new ListNode(number);
        testAllocation(newNode);

        //Shuffle pointers around to insert the new node into the list.
        newNode->next = chosenNode.current->next;
        chosenNode.current->next = newNode;

        //Check if the new node is pointing to NULL and if it is, make it the new tail.
        if (!newNode->next)
            tail = newNode;
        
        //Increment size.
        ++size;
    }
}
/****************************** List::insertAfter **************************************************
Action:         Inserts a new node after the specified node.  If the chosen node is NULL, then it
                inserts the node at the front of the list and calls the insertFront function to do
                so.  Updates the head, tail, and size attributes appropriately, as needed.

Parameters:
IN:             ListIterator chosenNode, contains the location of the node that the new node will be
                inserted after.
IN:             int number, contains the number which will be added as a new node.
OUT:            None

Returns:        Nothing

Precondition:   None
***************************************************************************************************/
:insertAfter
Action:         Inserts a new node after the specified node.  If the chosen node is NULL, then it
inserts the node at the front of the list and calls the insertFront function to do
so.  Updates the head, tail, and size attributes appropriately, as needed.

ListIterator chosenNode, contains the location of the node that the new node will be
inserted after.
IN:             int number, contains the number which will be added as a new node.
OUT:            None

Nothing

None
: insertAfter Action : Inserts a new node after the specified node . If the chosen node is NULL then it inserts the node at the front of the list and calls the insertFront function to do so . Updates the head tail and size attributes appropriately as needed . ListIterator chosenNode contains the location of the node that the new node will be inserted after . IN : int number contains the number which will be added as a new node . OUT : None Nothing None
void List::insertAfter(ListIterator chosenNode, int number)
{
    if (!chosenNode)
        insertFront(number);
    else
    {
        ListNode *newNode = new ListNode(number);
        testAllocation(newNode);
        newNode->next = chosenNode.current->next;
        chosenNode.current->next = newNode;
        if (!newNode->next)
            tail = newNode;
        ++size;
    }
}
void List :: insertAfter ( ListIterator chosenNode , int number ) { if ( ! chosenNode ) insertFront ( number ) ; else { ListNode * newNode = new ListNode ( number ) ; testAllocation ( newNode ) ; newNode -> next = chosenNode . current -> next ; chosenNode . current -> next = newNode ; if ( ! newNode -> next ) tail = newNode ; ++ size ; } }
List::insertAfter
Action:         Inserts a new node after the specified node.
List :: insertAfter Action : Inserts a new node after the specified node .
//If the iterator is NULL, insert at the head of the list. //If the iterator is not null, insert where it points. //Allocate memory for a new List Node and check it for validity. //Shuffle pointers around to insert the new node into the list. //Check if the new node is pointing to NULL and if it is, make it the new tail. //Increment size.