Question

Two Level 200 IT students, Afiriyie and Agyemang, are discussing how to compare two algorithms for...

  1. Two Level 200 IT students, Afiriyie and Agyemang, are discussing how to compare two algorithms for solving a given problem. James suggests that they should use the execution times of the algorithms as criterion; but Morris insists that they should use the number of statements the algorithms execute as criterion.

  1. Explain the reasons why both criteria they are considering are not good for comparing algorithms.

  1. Recommend an ideal solution/criterion that they should rather use for comparing algorithms. Give a practical example to illustrate your answer.

Homework Answers

Answer #1

1.

The reason considering any of the criterions mentioned is that

If the first criterion is taken into account, we may choose the algorithm with lesser execution time as compared to others but just depending upon this we can't judge how efficient the algorithm is. It may provide faster results but if the space is increased then it won't work. Hence considering only the execution view is not suitable.

If the second criterion is taken into account, the higher the statements executed the better. But this will drastically slow down the process. Hence taking the number of statements executed alone will not show the side effects and important factor that is speed.

Now if both the alogorithms are compared in this way, each of it will lack in something.

2.

An ideal solution to compare the algorithms can be considering complexity, both time and space.

Example :

First define the purpose of your algorithm

Merge sort vs Bubble sort-

Space-wise Bubble sort requires less memory, while Merge sort requires more

Time-wise Bubble sort takes more time, while Merge sort requires less

So if we were to choose between these both algorithms, we choose Bubble where memory is limited and Merge when there's a lot of space. But usually the preference would go to Merge if the memory is present as the time complexity is O(nlogn), whereas for Bubble it's O(n).

comment for any clarifications!

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
Q No.15: In a discussion between Peters and Ferrel, two auditing students, Peters made the following...
Q No.15: In a discussion between Peters and Ferrel, two auditing students, Peters made the following statement:    “A CIA is a professional person who is licensed by the state for the purpose of providing independent expert opinion on the fairness of financial statements. To maintain an attitude of mental independence and objective in all phase of audit work, it is advisable that the CIA not fraternize with client personnel. The CIA should be courteous but reserved and dignified at...
The project has been performing as planned, and the team members have been exhibiting increasing levels...
The project has been performing as planned, and the team members have been exhibiting increasing levels of trust between each other. The sponsor and the buyer have been satisfied with the delivery of business value, and user acceptance testing results are positive. A technical expert consulting with the team has expressed concerns that the team is not in agreement on the best way to deliver to the next review. If the project manager wants to support the team in reaching...
1.Establishing the virtual Management: As known, managing virtual staff requires a different method or approach than...
1.Establishing the virtual Management: As known, managing virtual staff requires a different method or approach than managing local staff. Due to that reason, Golden Scent has developed a strategic plan to successfully manage its virtual staff in the USA. Identify the suitable manager. to make sure our work will proceed as we planned, Golden Scent willrecruit a virtual manager with the essential skills and knowledge required to manage virtual employees. Find the skilled people to work with. Since not everyone...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From the April 2004 Issue Save Share 8.95 In 1991, Progressive Insurance, an automobile insurer based in Mayfield Village, Ohio, had approximately $1.3 billion in sales. By 2002, that figure had grown to $9.5 billion. What fashionable strategies did Progressive employ to achieve sevenfold growth in just over a decade? Was it positioned in a high-growth industry? Hardly. Auto insurance is a mature, 100-year-old industry...
read Seasons of Love chapter:measuring a child's life after suicide. please answer the questions : reflect...
read Seasons of Love chapter:measuring a child's life after suicide. please answer the questions : reflect on what happens to the families when there is a suicide in the family, based on the Seasons of Love chapter...how should people be told? What details are best left unshared? below is the story These theories may have a certain face-validity, but they often neglect environmental or contextual factors that are innate to answering the question of “why” a person might engage in...
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation....
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation. case:    W17400 APIGEE: PEOPLE MANAGEMENT PRACTICES AND THE CHALLENGE OF GROWTH Ranjeet Nambudiri, S. Ramnarayan, and Catherine Xavier wrote this case solely to provide material for class discussion. The authors do not intend to illustrate either effective or ineffective handling of a managerial situation. The authors may have disguised certain names and other identifying information to protect confidentiality. This publication may not be...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
In February 2012, the Pepsi Next product was launched into the US market. This case study...
In February 2012, the Pepsi Next product was launched into the US market. This case study provides students with an interesting insight into PepsiCo’s new product process and some of the challenging decisions that they faced along the way. Pepsi Next Case Study Introduction Pepsi Next was launched by PepsiCo into the US market in February 2012, and has since been rolled out to various international markets (for instance, it was launched in Australia in September 2012). The new product...