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: 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 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: 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: Discuss the ways in which business...
Respond to the following in a minimum of 175 words: Discuss the ways in which business to business buying behavior differs from consumer purchasing. Consider in your discussion the purchasing decision as well and ways to measure customer satisfaction and loyalty.
Respond to the following in a minimum of 175 words: Discuss the role that pension funds...
Respond to the following in a minimum of 175 words: Discuss the role that pension funds play in company pension plans. What benefits accrue to companies who elect to use pension funds? How does the use of a pension fund change the accounting that must be done with respect to employee pension amounts?
Respond to the following in a minimum of 175 words: Discuss the major similarities and differences...
Respond to the following in a minimum of 175 words: Discuss the major similarities and differences in accounting for for-profit and not-for-profit organizations. Be sure to consider differences in organizational ownership, fund accounting, and financial reporting.
Respond to the following in a minimum of 175 words: Discuss the deductibility of real property...
Respond to the following in a minimum of 175 words: Discuss the deductibility of real property taxes.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT