Menu

[Solved]Following Problems Develop Answers Post Answers Discussion Forum Review Responses Least 3 Q37260928

For the following problems, develop your own answers and postyour answers to the discussion forum. Review the responses of atleast 3 of your peers. If you find that your peer has come up witha different answer than your own, engage your peer in a dialogue to‘compare notes’ to determine where the problemlies.  

If you have discovered a different way of understanding the problemor solving the problem share your approach with your peers. Theobjective of this assignment is to collaboratively learn anddevelop correct results for each of the problems. Asymptoticanalysis is a difficult concept to master as such we will allbenefit by understanding each others perspectives.

1. Suppose that algorithm A takes 1000n3 steps andalgorithm B takes 2n steps for a problem of size n. Forwhat size of problem is algorithm A faster than B (meaningalgorithm A has fewer steps than B)? In your answer describe notonly what the answer is but how you arrived at theanswer.  

2. Give the upper bound (big O notation) that you can for thefollowing code fragment, as a function of the initial value ofn.

for(int i = 0; i < n; i++) {
for(int j = 0; j < i; j++){
//do swap stuff, constant time
}
}

Do you think that the lower bound is likely to be the same as theanswer you gave for
the upper bound? In your response state why or why not.

Expert Answer


Answer to For the following problems, develop your own answers and post your answers to the discussion forum. Review the responses… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *