Question 1 (25 pts):Assume the following list of keys:49, 4, 89, 25, 67, 46, 83, 30, 60, 22, 12This list is to be sorted using the quick sort algorithm a

Question 1 (25 pts):Assume the following list of keys:49, 4, 89, 25, 67, 46, 83, 30, 60, 22, 12This list is to be sorted using the quick sort algorithm as discussed in this chapter. Use pivot as the middleelement of the list, and fill in the blank squares below.pivotpivot pivotpivot pivot pivot pivotpivot pivotpivot pivot49, 4, 89, 25, 67, 46, 83, 30, 60, 22, 12Question 2 (25 pts):Assume the following list of keys:32, 47, 3, 28, 92, 7, 87, 37, 22, 43, 40, 74, 13, 35, 51This list is to be sorted using the merge sort algorithm as discussed in this chapter. Fill in the blank squaresbelow.32, 47, 3, 28, 92, 7, 87, 37, 22, 43, 40, 74, 13, 35, 51Question 3 (25 pts):Assume the following list:32, 47, 3, 28, 92, 7, 87, 37, 22, 43, 40, 74, 13, 35, 51, 14, 26, 5(a) Using the function buildHeap as given in this chapter, convert the list into a heap.(b) Show the resulting list after three passes of heapsort. (Use the heapify procedure as given in this chapter.)One pass:Two passes:Three passes:Question 4 (25 pts):Modify the quick sort implementation in the textbook to sort the array using pivot as the median of the first, last,and middle elements of the array. Add the modified quick sort implementation to the arrayListType classprovided (arrayListType.h). Ask the user to enter a list of positive integers ending with -999, sort the integers, anddisplay the pivots for each iteration and the sorted array.Submit the source code, and copy and paste the screenshot of the output here

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Mutex  locks and semaphores, as discussed in class, are different techniques to  solve the race condition and to ensure an efficient synchronization

Mutex  locks and semaphores, as discussed in class, are different techniques to  solve the race condition and to ensure an efficient synchronization  between cooperating threads and processes. you will use semaphores to  solve a number of synchronization problems between cooperating threads. important to note that: •  Semaphore, in literature, uses

(Financial application: compute the future  investment value) Write a method that computes future investment value  at a given interest rate for a

(Financial application: compute the future  investment value) Write a method that computes future investment value  at a given interest rate for a specified number of years. The future  investment is determined using the formula in Programming Exercise 2.21.  Use the following method header: public static double  futureInvestmentValue(double investmentAmount, double  monthlyInterestRate,

Task 2: Text Counter (USING JAVAFX) Develop a class TextCounter that extends javafx.scene.text.Text and implements Runnable. Your layout should appear

Task 2: Text Counter (USING JAVAFX) Develop a class TextCounter that extends javafx.scene.text.Text and implements Runnable. Your layout should appear similar to the image below.  Next, develop a class IntCounter that has an integer counter intialised to 0, and methods incrementCount, getCount and setCount.  For this application, create Start, Pause

Task 2: Text Counter (USING JAVAFX) Develop a class TextCounter that extends javafx.scene.text.Text and implements Runnable. Your layout should appear

Task 2: Text Counter (USING JAVAFX) Develop a class TextCounter that extends javafx.scene.text.Text and implements Runnable. Your layout should appear similar to the image below.  Next, develop a class IntCounter that has an integer counter intialised to 0, and methods incrementCount, getCount and setCount.  For this application, create Start, Pause