assign6_s_f88/ProductInventory.cpp
/*****************************************************************************
 sortInventory: sorts inventory
 returns: NO RETURN Void Function
 ****************************************************************************/
sorts inventory
returns: NO RETURN Void Function
sorts inventory returns : NO RETURN Void Function
void ProductInventory::sortInventory()
{
    ProductNode* newList = NULL;    
    ProductNode* temp = NULL;       
    if (productList == NULL)
    {
        return;
    }
    while (productList != NULL)
    {
        if (temp == NULL)
        {
            temp = new ProductNode;
            newList = temp;
        }
        else
        {
            temp->next = new ProductNode;
            temp = temp->next;
        }
        temp->next = NULL;
        temp->data = findMinimum();
        removeProduct(temp->data.getProductName(), temp->data.getLocator());
    }
    productList = newList;
}
void ProductInventory :: sortInventory ( ) { ProductNode * newList = NULL ; ProductNode * temp = NULL ; if ( productList == NULL ) { return ; } while ( productList != NULL ) { if ( temp == NULL ) { temp = new ProductNode ; newList = temp ; } else { temp -> next = new ProductNode ; temp = temp -> next ; } temp -> next = NULL ; temp -> data = findMinimum ( ) ; removeProduct ( temp -> data . getProductName ( ) , temp -> data . getLocator ( ) ) ; } productList = newList ; }
sortInventory: sorts inventory
returns: NO RETURN Void Function
sortInventory : sorts inventory returns : NO RETURN Void Function
//points at NULL, transition
 //points at NULL, space holder
 // Just move temp up the new list each iteration, appending a new node
 // with the minimum
 // Check for the head of the new list
 // Remove old ProductNode
