Question

Explain why timing the sorting program is not a good method to measure the efficiency of...

Explain why timing the sorting program is not a good method to measure the efficiency of the program.

Homework Answers

Answer #1

Timing a sorting program is not a good way to measure the efficiency of the program. This is because various sorting algorithms work differently, based on the arrangement of values of the data.

e.g. The time complexity for quick sort in a general case is O(nlog n), but if the array is already sorted in ascending or descending order, or all the elements of the array are same, then this complexity becomes O(n^2). If insertion sort is applied on a sorted array, then the complexity is O(n). Thus, we can see how the sorting algorithm performance is highly data dependent. Hence, timing the sorting program is not the best way to measure the efficiency of the program.

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
Explain why timing the sorting program is not a good method to measure the efficiency of...
Explain why timing the sorting program is not a good method to measure the efficiency of the program.
Explain why the term radius is a good measure for the size of an atom? What...
Explain why the term radius is a good measure for the size of an atom? What shape is an atom?
Explain why the timing of fiscal policy may be more difficult than the timing of monetary...
Explain why the timing of fiscal policy may be more difficult than the timing of monetary policy.
Explain why the modified duration measure only gives good estimates of price changes when the change...
Explain why the modified duration measure only gives good estimates of price changes when the change in the market interest rate being considered is small.
Is the CPI a good measure of inflation for you personally? Why or why not?
Is the CPI a good measure of inflation for you personally? Why or why not?
explain some reasons why real GDP may not br a good measure when comparing how well...
explain some reasons why real GDP may not br a good measure when comparing how well people are doing from one year to the next.
8. Discuss why the Real GDP is a good measure of a countries economic well being...
8. Discuss why the Real GDP is a good measure of a countries economic well being and why it is a poor measure. a. (5 points) Why is the real GDP a good measure. b. (5 points) Why is the real GDP a poor measure.
Is GDP a good measure for the general welfare or standard of living in a country?...
Is GDP a good measure for the general welfare or standard of living in a country? Explain why or why not?
Explain why the timing of changes in skin temperature supports homeostasis (why does a person’s body...
Explain why the timing of changes in skin temperature supports homeostasis (why does a person’s body deal with the increased heat produced with increased metabolism the way it does, considering the need to maintain Tb AND move O2 and CO2 to support increased metabolism…?).
find a good alarm explain why it is good? finad a bad alarm and explain why...
find a good alarm explain why it is good? finad a bad alarm and explain why it is bad? how you fix it?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT