Homework/HW03/ListIterator.cc
bool ListIterator::swap(ListIterator &other)
{
    if (current && other) // if neither node is NULL
    {
        // swap the datums
        int temp = current->datum;
        current->datum = *other;
        *other = temp;

        return true;  // success
    }
    else
        return false; // failure
}
// Swaps the content of the target object with the other iterator if
// they are both not null. If one of them is null the function returns
// false, otherwise true.
Swaps the content of the target object with the other iterator if
they are both not null. If one of them is null the function returns
false, otherwise true.
Swaps the content of the target object with the other iterator if they are both not null . If one of them is null the function returns false otherwise true .
bool ListIterator::swap(ListIterator &other)
{
    if (current && other) 
    {
        int temp = current->datum;
        current->datum = *other;
        *other = temp;
        return true;  
    }
    else
        return false; 
}
bool ListIterator :: swap ( ListIterator & other ) { if ( current && other ) { int temp = current -> datum ; current -> datum = * other ; * other = temp ; return true ; } else return false ; }
Swaps the content of the target object with the other iterator if
they are both not null.
Swaps the content of the target object with the other iterator if they are both not null .
// if neither node is NULL // swap the datums // success // failure