PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Failing t105. Medium length file
Date: Monday, 30 Mar 2020, 21:05:30


    > Message Posted By: Unknown
    >
    > I am still at the stage of trying to figure out how to write a Quicksort
    > that adheres to the specifications and have so far only have a function
    > that makes two new deques at every recursive call.

That is a good start.  Now think about how you can use
only two stacks and one queue instead.  Much of the code
that you have written (e.g., distributing the items on
one Deque to two other Deques and copying items from one
Deque to another) can easily be adapted to the new
algorithm.
=====

    > I was wondering if failing t105 is something I should be worried about at
    > this stage (in other words, should a regular function that makes two new
    > deques at each recursive call be expected to pass this test or not?) or if
    > failing that test case should naturally solve itself if I can figure out
    > an efficient Quicksort algorithm?

How long does your Qsort take to run #105?  That is,
what does

  % /bin/time /c/cs223/Hwk4/Tests/t105

take to run.  (Please send the answer directly to me
rather than posting, so that we do not waste everyone's
time.  Thanks.)

--Stan-
PREV INDEX NEXT