lab/lab12/MergeSort.java
private static <Item extends Comparable> Queue<Item> mergeSortedQueues(
            Queue<Item> q1, Queue<Item> q2) {

        Queue<Item> q = new Queue<>();

        while (!q1.isEmpty() || !q2.isEmpty()) {
            q.enqueue(getMin(q1, q2));
        }

        return q;
    }
/**
     * Returns a new queue that contains the items in q1 and q2 in sorted order.
     *
     * This method should take time linear in the total number of items in q1 and q2.  After
     * running this method, q1 and q2 will be empty, and all of their items will be in the
     * returned queue.
     *
     * @param   q1  A Queue in sorted order from least to greatest.
     * @param   q2  A Queue in sorted order from least to greatest.
     * @return      A Queue containing all of the q1 and q2 in sorted order, from least to
     *              greatest.
     *
     */
Returns a new queue that contains the items in q1 and q2 in sorted order.
This method should take time linear in the total number of items in q1 and q2.  After
running this method, q1 and q2 will be empty, and all of their items will be in the
returned queue.

@param   q1  A Queue in sorted order from least to greatest.
@param   q2  A Queue in sorted order from least to greatest.
@return      A Queue containing all of the q1 and q2 in sorted order, from least to
greatest.
Returns a new queue that contains the items in q1 and q2 in sorted order . This method should take time linear in the total number of items in q1 and q2 . After running this method q1 and q2 will be empty and all of their items will be in the returned queue . @param q1 A Queue in sorted order from least to greatest . @param q2 A Queue in sorted order from least to greatest . @return A Queue containing all of the q1 and q2 in sorted order from least to greatest .
private static <Item extends Comparable> Queue<Item> mergeSortedQueues(
            Queue<Item> q1, Queue<Item> q2) {
        Queue<Item> q = new Queue<>();
        while (!q1.isEmpty() || !q2.isEmpty()) {
            q.enqueue(getMin(q1, q2));
        }
        return q;
    }
private static < Item extends Comparable > Queue < Item > mergeSortedQueues ( Queue < Item > q1 , Queue < Item > q2 ) { Queue < Item > q = new Queue < > ( ) ; while ( ! q1 . isEmpty ( ) || ! q2 . isEmpty ( ) ) { q . enqueue ( getMin ( q1 , q2 ) ) ; } return q ; }
Returns a new queue that contains the items in q1 and q2 in sorted order.
Returns a new queue that contains the items in q1 and q2 in sorted order .