Author: Stan Eisenstat
Subject: Re: [Cs223] Deque implementation
Date: Thursday, 19 Mar 2020, 08:41:23
> Message Posted By: Unknown
>
> If we use the implementation of the deque where a deque is headed (ie. the
> deque is always a struct that comprises 2 fields (H and T), even when
> empty), then is it true that *d will never change for the functions
> declared in Deque.c/Deque.h? Are there any possible cases we should think
> about for when *d may change?
For THAT implementation the value of *d will not change
until the Deque is destroyed.
However, this property is not part of the interface
specified in Hwk4/Deque.h, so your Qsort may not assume
that it is satisfied.
=====
> Furthermore, is there any disadvantage to using this implementation? The
> spec and your answers above seem to suggest that your implementation of
> deque may be better.
There is no disadvantage to such an implementation.
The purpose of Hwk4/Deque.o is to ensure that your
implementation of Qsort does not rely on *d not
changing.
--Stan-
PREV
INDEX
NEXT