Question: Which one of the following statements about sorting and big-Oh is true? a. Selection sort can sort an array of integers in O(N) time. b.

Which one of the following statements about sorting and big-Oh is true?

a. Selection sort can sort an array of integers in O(N) time.

b. Merge sort achieves an O(N log N) runtime by dividing the array in half at each step and then recursively sorting and merging the halves back together.

c. Merge sort runs faster than selection sort because it is recursive, and recursion is faster than loops.

d. Selection sort runs in O(N) time if the array is already sorted to begin with, or O(N2) if it is not.

e. Sorting algorithms that rely on comparing elements can only be used with type int, because values from other types of data cannot be compared to each other.

Step by Step Solution

3.46 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The following statement about sorting and ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Building Java Programs A Back to Basics Approach Questions!