1 answer

We were unable to transcribe this imageOnline Final Exam If you follow the rules/restrictions provided, this...

Question:

media%2Ffd8%2Ffd8900c1-6630-4c85-9d3d-e9

Online Final Exam If you follow the rules/restrictions provided, this exam is optional and cannot hurt your gua ranteed lette

We were unable to transcribe this image
Online Final Exam If you follow the rules/restrictions provided, this exam is optional and cannot hurt your gua ranteed letter grade but may provide opporturity for improvement. questions about a variety af sorters so write these down because they will not be displayed again within the You will need to be able to answer the foliowing actual test and must be answered in order as indicated Answer cach of the following questions about the specified sorters as described in the order in which they are asked. Use your own words and do not include any code or code-like syntax: 1. State whether or not this sorter is stable as described 2. If stability can be altered by choices made during implementation, briefly explain what "choice" would impact stability or enter "NONE if it is not impacted by a choice briefly explain why the order s) indicated produce the best performance briefly explain why the order(s) indicated produce the worst performance 3. Considering 3 orders of data (ascending, descending, and random), indicate which order(s) are considered best case for performance and 4. Considering 3 orders of data (ascending, descending, and random), indicate which order(s) are considered worst case for performance and

Answers

1. No quick sort is not stable because if there are elements which are repeated and if such element is selected as pivot, then their order need not be same after quick sort .

2. Yes stability can be altered if we make the choice that if there are element with same value as pivot then the relative position of these elements are kept same as before quicksort. Hence if element p is pivot and element x has same value as p, then if x comes before p then even after sorting, x should be placed before p.

3. Quick sort has best performance when data is arranged either in ascending or descending order because in such order the partition of data is will be equal on both side since pivot is middle element.

4.

Quick sort will have worst performance when data is randomly arranged since the partition can be uneven.

Please comment for any clarification.

.

Similar Solved Questions

1 answer
Required information A thin aluminum sheet with an emissivity of 0.4 on both sides is placed...
Required information A thin aluminum sheet with an emissivity of 0.4 on both sides is placed between two very large parallel plates, which are maintained at uniform temperatures T1 = 904 K and T2 = 650 K and have emissivities £1 = 0.5 and 2 = 0.8, respectively. O =0.5 T2 = 650 K 2 = 0.8 Determ...
1 answer
What is the GCF of 45 and 26?
What is the GCF of 45 and 26?...
1 answer
Match each process to its most common use. System of Equations 1. Newton - Raphson Root...
Match each process to its most common use. System of Equations 1. Newton - Raphson Root Finding 2. Runge - Kutta Differentiation 3. Gauss - Seidel < Integration 4. Simpson's Rule < 5. Newton's Forward Difference Ordinal Differential Equations...
1 answer
Question 16 Data sets can have more than one median a. True b. False Question 17...
Question 16 Data sets can have more than one median a. True b. False Question 17 The median divides the data set, sequentially, by values below and values above the mode a. True b. False Question 18 This measure of central tendency provides the arithmetic average ...
2 answers
How do you find the domain and range of #f(x) = x/(x^2 +1)#?
How do you find the domain and range of #f(x) = x/(x^2 +1)#?...
1 answer
Find the value of Planck's constant h in eV*sec. Use it to find the frequency of...
Find the value of Planck's constant h in eV*sec. Use it to find the frequency of a 3-eV photon....
1 answer
Test#1 Name CVEN 435 Page 1/8 Initials) 1. A consolidated-drained (CD) triasial test was conducted on...
Test#1 Name CVEN 435 Page 1/8 Initials) 1. A consolidated-drained (CD) triasial test was conducted on a ơ)-250 kNm, and the deviator clay. The results were as follows: confining stress at failure, (Aoah 250Nm friction.(2) angle 6 that the failure plane makes with the major principal plane, and ...
1 answer
Part C. Calculate how many times more soluble Mg(OH), is in pure water Based on the...
Part C. Calculate how many times more soluble Mg(OH), is in pure water Based on the given value of the Kp, calculate the ratio of solubility of Mg(OH), dissolved in pure H, 0 to Mg(OH), dissolved in a 0.180 M NaOH solution Express your answer numerically to three significant figures. View Available ...
1 answer
QUESTION 8 Ethics are important because suppliers prefer to deal with ethical companies. customers prefer to...
QUESTION 8 Ethics are important because suppliers prefer to deal with ethical companies. customers prefer to deal with ethical companies. employees prefer to deal with ethical companies. all of the choices....
1 answer
How do you find the discriminant of #x^2-2x+4=0# and use it to determine if the equation has one, two real or two imaginary roots?
How do you find the discriminant of #x^2-2x+4=0# and use it to determine if the equation has one, two real or two imaginary roots?...
1 answer
New parents wish to save for their newborn's education and wish to have $40,000 at the...
New parents wish to save for their newborn's education and wish to have $40,000 at the end of 19 years. How much should the parents place at the end of each year into a savings account that earns an annual rate of 5.1% compounded annually? (Round your answers to two decimal places.) $  ...
1 answer
6. In Problem 1, show that θ2 is a consistent estimator for θ. Deduce that Y(n) is a consistent e...
Please answer as neatly as possible. Much thanks in advance! Question 1: 6. In Problem 1, show that θ2 is a consistent estimator for θ. Deduce that Y(n) is a consistent estimator for θ and also asyınpt○tically unbiased estimator for θ. 1. Let Yi, ½, . . . ,...
1 answer
Balanced Scorecard, Perspectives, Classification of Performance Measures Consider the following list of scorecard measures: Required: Classify...
Balanced Scorecard, Perspectives, Classification of Performance Measures Consider the following list of scorecard measures: Required: Classify each measure according to the following: perspective, financial or nonfinancial, subjective or objective, and external or internal. When the perspective is p...
1 answer
Prepare journal entries to record each of the following transactions. The company records purchases using the...
Prepare journal entries to record each of the following transactions. The company records purchases using the gross method and a perpetual inventory system. Aug. 1 Purchased mercharidise with an invoice price of $108,000 and credit teres of 3/10, n/30. Aug. 11 Paid supplier the amount owed from the ...
1 answer
Name: 18. The current vaccine for S. pneumoniae is made up of 23 different capsular polysaccharides....
Name: 18. The current vaccine for S. pneumoniae is made up of 23 different capsular polysaccharides. How would you propose to make a protein-targeted vaccine that is protective to all S. pneumoniae serotypes? Hint: you first need to figure out what proteins are recognized by immune people. Include t...
1 answer
What is the difference between retention and inversion in organic chemistry stereochemistry. Provide examples please
What is the difference between retention and inversion in organic chemistry stereochemistry. Provide examples please...