Question

Given a large array of several million elements of type 'double', you are asked to sort...

Given a large array of several million elements of type 'double', you are asked to sort them in ascending order using an algorithm of your choice. You choose selection sort. Why is this a poor choice?

Group of answer choices

Selection sort can only sort elements of type 'int'

Selection sort requires 3x the memory of other sort algorithms

Selection sort can only work on an array with an odd number of elements

Selection sort will be prohibitively inefficient for large arrays

Homework Answers

Answer #1

Selection sort can sort elements of type integer, float, and double data type as well therefore option A is incorrect.

The space complexity of selection sort is O(1) which is the least in comparison to other sorting algorithm, therefore it is incorrect to say that Selection sort requires 3x the memory of other sort algorithms, hence option B is also incorrect.

Selection sort can also work on an array with an even number of elements therefore option C is also incorrect.

Selection sort is a in-place comparison based sorting algorithm and if the array size increases then the comparison will also increased therefore selection sort is insufficient for the array of larger size, hence option D is correct.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT