Author: Stan Eisenstat
Subject: Re: [Cs223] Is testDeque handling failed pops() incorrectly?
Date: Tuesday, 17 Mar 2020, 08:06:34
> Message Posted By: Unknown > > I'm running testDeque with my own Deque ADT and when I try to remove > elements on an empty Deque, the output is garbled. Here is my sequence of > commands: > CA > AA1 > AA2 > RA > 1 > RA > 2 > RA > remD(A) failed: M-oM-?M-=rW > > When I run valgrind with the same exact input, the first error is an > Invalid Read of Size 1 with traces back to testDeque. > > Is this a problem with testDeque or is it a problem with my Deque > implementation? This is a problem with your implementation of the Deque ADT. The likely cause is not adhering to the interface specification: // Remove the string pointer at the head of the Deque *D and store that value // (or NULL if the Deque is empty) in *S. The value of *D may change as a // result. but without seeing your code, I cannot be sure. --Stan-PREV INDEX NEXT