Consider the quick sort algorithm as implemented in the text using the sort pattern. Which of the following data characteristics give the fastest run time? Explain.

a) An array sorted into increasing values.
b) An array sorted into decreasing values.
c) An array of random values
d) An array that increases for half the array, then decreases


c) An array of random values

All the other choices guarantee split gives subarrays of size 1 and N-1, hence give quadratic performance. Part d) requires a little thought, but it too gives quadratic runtime.

Computer Science & Information Technology

You might also like to view...

The second task described in a task dependency is called the ____________________ task.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A digital signature may be visible or invisible and is authenticated by the ________

A) source of the signature B) target of the signature C) name on the signature D) file of the signature

Computer Science & Information Technology

Critical Thinking Questions Case 1 ? You have the Save As dialog box open and you are naming a file on which you have been working.? ?You have been trying to name your first communication to one of your clients COM1. Why will this not work?

A. ?You cannot use all caps in a file name. B. ?You cannot use the numeral 1 in a file name. C. ?The name is reserved by the operating system. D. ?This will in fact work.

Computer Science & Information Technology

Describe the concept of a virtual switch.

What will be an ideal response?

Computer Science & Information Technology