import java.util.Comparator; import components.queue.Queue; import components.queue.Queue1L; /** * Layered implementations of secondary method {@code sort} for * {@code Queue}. */ public final class Queue1LSort1 extends Queue1L { /** * No-argument constructor. */ public Queue1LSort1() { super(); } /** * Removes and returns the minimum value from {@code q} according to the * ordering provided by the {@code compare} method from {@code order}. * * @param q * the queue * @param order * ordering by which to compare entries * @return the minimum value from {@code q} * @updates q * @requires
     * q /= empty_string  and
     *  [the relation computed by order.compare is a total preorder]
     * 
* @ensures
     * perms(q * , #q)  and
     *  for all x: string of character
     *      where (x is in entries (q))
     *    ([relation computed by order.compare method](removeMin, x))
     * 
*/ private static String removeMin(Queue q, Comparator order) { assert q != null : "Violation of: q is not null"; assert order != null : "Violation of: order is not null"; // TODO - fill in body /* * This line added just to make the program compilable. Should be * replaced with appropriate return statement. */ return ""; } @Override public void sort(Comparator order) { assert order != null : "Violation of: order is not null"; // TODO - fill in body } }