1 show the steps used by the shaker sort to sort the list 3


The shaker sort (or bidirectional bubble sort) successively compares pairs of adjacent elements, exchanging them if they are out of order, and alternately passing through the list from the beginning to the end and then from the end to the beginning until no exchanges are needed

1. Show the steps used by the shaker sort to sort the list 3, 5, 1, 4, 6, 2.

2. Express the shaker sort in pseudo code.

3. Show that the shaker sort has O(n2complexity measured in terms of the number of comparisons it uses.

4. Explain why the shaker sort is efficient for sorting lists that are already in close to the correct order.

5. Show that (n log n2)3 is O(n6).

6. Show that 8x3+ 12+ 100 log is O(x3).

7. Give a big-estimate for (x2 + x(log x)3· (2xx3).

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: 1 show the steps used by the shaker sort to sort the list 3
Reference No:- TGS02248469

Now Priced at $35 (50% Discount)

Recommended (97%)

Rated (4.9/5)