Question

In: Computer Science

Respond to the following in a minimum of 175 words: Discuss what you consider to be...

Respond to the following in a minimum of 175 words:

Discuss what you consider to be the first and second priority in a sorting algorithm and justify a key word or phrase to place in the string that is crucial.


Provide a short pseudocode example in your discussion post to defend your thoughts.


Explain your reasoning for selecting your first and second priorities.

Solutions

Expert Solution

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

First priority is given to the time requirement of the execution of algorithm, that is known as time complexity of the algorithm.

Time complexity represents the time requirement for the execution of the algorithm related to the input size. Time complexity of various algorithms are O(n2 ),O(n log n) etc. if the time complexity is O(n2 ) , it represents that the time required to execute the algorithm directly proportional to the square of the input size.

for eg: the pseudo code for bubble sort algorithm is

for(i=0;i<=n-2;i++)

{

for (j=0;j<=n-2-i; j++)

{

if(a[j]>a[j+1])

{

t=a[j];

a[j]=a[j+1];

a[j+1]=t;

} } }

here ‘n’ represents the number of inputs. this algorithm take the time directly proportional to the square of its input size.

other sorting methods like bucket sort algorithm has the complexity O(n+k) in average case. this means that , the algorithm take a time proportional to size of number of inputs (n) and the bucket size (k). so this algorithm is much faster than bubble sort algorithm in case of large inputs.

Second priority given to the way of implementation:

The way of implementation means, some algorithms are very simple to implement such as bubble sort even though they are slow in execution. Similarly some algorithms are difficult to implement, but they are fast in execution such as quicksort algorithm. If the input size is small bubble sort algorithm is good , because of simple implementation. In case of large input size quick sort algorithm is good, because of its faster execution.

Kindly revert for any queries

Thanks.


Related Solutions

Respond to the following in a minimum of 175 words: Discuss what you can expect to...
Respond to the following in a minimum of 175 words: Discuss what you can expect to occur in the exit interview. How would you refute a finding you disagree with? How would you handle guidance you do not necessarily plan to implement? How would you expect to work with the audit team to ensure that the guidance the audit provides is implemented?
Respond to the following in a minimum of 175 words: What are issues to consider when...
Respond to the following in a minimum of 175 words: What are issues to consider when deciding to build software in-house or purchase commercial off-the-shelf software (COTS)? If you were asked to evaluate several COTS applications and choose whether to develop in-house or purchase a COTS application, what criteria are important to consider and why? How would you decide?   Usually, in-house development is not something big companies are pursuing. We do have in house developers to help with customizations and...
Respond to one of the following in a minimum of 175 words: 1) Discuss: What are...
Respond to one of the following in a minimum of 175 words: 1) Discuss: What are the limitations of GDP as a measurement tool?
Respond to the following prompts in a minimum of 175 words: Consider a recent interaction you...
Respond to the following prompts in a minimum of 175 words: Consider a recent interaction you have had with a co-worker or item that you saw in the media that might have included logical errors. Share the example as well as the logical errors that are present in the example. Be sure to use terms and concepts from the content covered this week to support your discussion.
Respond to the following in a minimum of 175 words: What is the purpose of an...
Respond to the following in a minimum of 175 words: What is the purpose of an income statement, and who is the audience for this document? What components do income statements typically contain? Why?
Respond to the following in a minimum of 175 words: What is the purpose of a...
Respond to the following in a minimum of 175 words: What is the purpose of a Comprehensive Annual Financial Report, or CAFR? What standards must a CAFR comply with? What statements comprise a CAFR?
Due Thursday Respond to the following in a minimum of 175 words: Discuss what happens if...
Due Thursday Respond to the following in a minimum of 175 words: Discuss what happens if your site visitors are running browsers that lack HTML5 support for those input types. On the other hand, if you use JavaScript® to validate input data, what happens if your site visitors have JavaScript® turned off in their browsers? Choose one of the following three positions for validating form input effectively, and defend it based on what you have read or watched in this...
Respond to the following in a minimum of 175 words: Discuss what elements should be present...
Respond to the following in a minimum of 175 words: Discuss what elements should be present in an implementation plan. Provide a specific example to illustrate your reasoning.
Respond to the following in a minimum of 175 words: Consider a potential business problem that...
Respond to the following in a minimum of 175 words: Consider a potential business problem that would require a computer program solution. How could an algorithm be used to solve a problem that a business may encounter? Provide specific examples.
Respond to the following in a minimum of 175 words: This week, we consider how to...
Respond to the following in a minimum of 175 words: This week, we consider how to conduct hypotheses test on one sample data. Discuss the concepts associated with these tests. Consider the following: The difference between a one tail and a two tailed test. The importance of stating the null and alternative hypotheses before conducting the test. The importance of a type one error (p) in conducting the test   The relationship between the p value and our decision to accept...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT