PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Invalid argument/Inconsistent Deque object
Date: Saturday, 14 Mar 2020, 14:35:11


    > Message Posted By: Unknown
    >
    > In Deque.h, it says the functions must return false if the argument is
    > invalid or if the Deque object is inconsistent, among other things. Is an
    > argument invalid only if the passed in Deque is null? Also, how can we
    > check if a Deque object is inconsistent?

Yes.

That depends on your internal implementation of the
Deque object.  (For example, if it stores the numbers of
items in the H and T stacks, then it is inconsistent if
one of these numbers is nonzero but the corresponding
stack is empty.

--Stan-
PREV INDEX NEXT