Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

1. Write a program to read a list of grade point averages (0.0 - 4.0) from a text file and sort them in descending order. Select the most efficient sorting algorithm for your program.

2. Some algorithms are too complex to analyze using simple big-O notation or a representative data set may not be easily identifiable. In these cases, we must actually execute and test the algorithms on different sized data sets and compare the results. Special care must be taken to be fair in the actual implementation and execution of the different algorithms. This is known as an empirical analysis. We can also use an empirical analysis to verify and compare the time-complexities of a family of algorithms such as those for searching or sorting.

Design and implement a program to evaluate the efficiency of the comparison sorts used with sequences by performing an empirical analysis using random numbers. Your program should:

* Prompt the user for the size of the sequence: n.

* Generate a random list of n values (integers) from the range [0 . . . 4n].

* Sort the original list using each of the sorting algorithms, keeping track of the number of comparisons performed by each algorithm.

* Compute the average number of comparisons for each algorithm and then report the results.

When performing the empirical analysis on a family of algorithms, it is important that you use the same original sequence for each algorithm. Thus, instead of sorting the original sequence, you must make a duplicate copy of the original and sort that sequence in order to preserve the original for use with each algorithm.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92067224

Have any Question?


Related Questions in Computer Engineering

Why the ytms of bond and zero coupon yields are different

Why the YTMs of bond and Zero coupon yields are different for the same term.

An oil company determines it costs 25000 to sink a test

An oil company determines it costs $25,000 to sink a test well, an oil hit yields a net revenue of $475,000($500,000 gross-$25,000costs), and a natural gas hit yields $125,000 net revenue ($150,000 gross-$25,000 costs). ...

Suppose you are given a connected graph g with edge costs

Suppose you are given a connected graph G, with edge costs that are all distinct. Prove that G has a unique minimum spanning tree.

Titan mining corporation has 75 million shares of common

Titan Mining Corporation has 7.5 million shares of common stock outstanding, 275,000 shares of 4.7 percent preferred stock outstanding, and 160,000 bonds with a semiannual coupon rate of 5.6 percent outstanding, par valu ...

Reading the biographybook where the body meets memory by

Reading the Biography Book : "Where the Body Meets Memory" by David Mura Questions: INFERENCE AND ANALYSIS QUESTION - Mura is particularly interested in using italics and different font types to represent different peopl ...

Please respondexplain the properties and characteristics of

PLEASE RESPOND Explain the properties and characteristics of Transmission Control Protocol/Internet Protocol (TCP/IP).

Question critical infrastructures -1discuss cybersecurity

Question: Critical Infrastructures - 1. Discuss cybersecurity policy issues affecting SCADA and ICS systems for Critical Infrastructure services for the public, and compare those issues to the policy issues that affect t ...

When is a subclass a subclasswhen programming or solving

When is a Subclass a Subclass When programming, or solving any sort of problem for that matter, abstraction plays a key role in the decision-making process. It allows you to remove irrelevant details in order to understa ...

Search treestry to adopt all four traversal algorithm

Search trees. Try to adopt all four traversal algorithm procedures for any binary tree. Write methods to count the number of nodes in a binary tree to count the number of leaves to count the number of right children to f ...

Describe the definition of ransomware and what is wannacry

Describe the definition of ransomware. And what is wannacry threat?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As