Homework/HW03/ListIterator.cc
ListIterator ListIterator::min()
{
    ListIterator smallestFound = *this, currentTarget = *this;
    //ListNode *smallestFound = current, *currentTarget = current;

    //Cycle through the list until the end (NULL) is found.
    while (currentTarget)
    {
        //Compare datums and if currentTarget is smaller, set smallestFound equal to it.
        if (*currentTarget < *smallestFound)
        //if (currentTarget->getDatum() < smallestFound->getDatum())
            smallestFound = currentTarget;

        //Move on to the next Node.
        ++currentTarget;
        //currentTarget = currentTarget->getNext();
    }

    //Return a ListIterator containing the address of the smallest found number in the list.
    return ListIterator(smallestFound);
}
/****************************** ListIterator::min **************************************************
Action:         Locates the node containing the minimum number in the list starting from the target
                object (*this).  Returns a null iterator if the list is empty.  This is an accessor
                function and does not modify the target object.

Parameters:
IN:             None
OUT:            None

Returns:        ListIterator, pointing to the node which contains the minimum value in the list.

Precondition:   None
***************************************************************************************************/
:min
Action:         Locates the node containing the minimum number in the list starting from the target
object (*this).  Returns a null iterator if the list is empty.  This is an accessor
function and does not modify the target object.

None
OUT:            None

ListIterator, pointing to the node which contains the minimum value in the list.

None
: min Action : Locates the node containing the minimum number in the list starting from the target object ( * this ) . Returns a null iterator if the list is empty . This is an accessor function and does not modify the target object . None OUT : None ListIterator pointing to the node which contains the minimum value in the list . None
ListIterator ListIterator::min()
{
    ListIterator smallestFound = *this, currentTarget = *this;
    while (currentTarget)
    {
        if (*currentTarget < *smallestFound)
            smallestFound = currentTarget;
        ++currentTarget;
    }
    return ListIterator(smallestFound);
}
ListIterator ListIterator :: min ( ) { ListIterator smallestFound = * this , currentTarget = * this ; while ( currentTarget ) { if ( * currentTarget < * smallestFound ) smallestFound = currentTarget ; ++ currentTarget ; } return ListIterator ( smallestFound ) ; }
ListIterator::min
Action:         Locates the node containing the minimum number in the list starting from the target
object (*this).
ListIterator :: min Action : Locates the node containing the minimum number in the list starting from the target object ( * this ) .
//ListNode *smallestFound = current, *currentTarget = current; //Cycle through the list until the end (NULL) is found. //Compare datums and if currentTarget is smaller, set smallestFound equal to it. //if (currentTarget->getDatum() < smallestFound->getDatum()) //Move on to the next Node. //currentTarget = currentTarget->getNext(); //Return a ListIterator containing the address of the smallest found number in the list.