Question

1. Which of the following algorithms requires the most extra space when implemented? A. Quicksort B....

1. Which of the following algorithms requires the most extra space when implemented?

A. Quicksort

B. Mergesort

C. Radix sort

D. All use the same amount of extra space

2. Sort this array into ascending order: 80 90 70 85 60 40 50 95. Assume the pivot is 40. (SHOW WORK)

A. (40) and (50 60 70 80 85 90 95)

B. () and (80 90 70 85 60 50 95)

C. () and (50 60 70 80 85 90 95)

D. () and (80 50 60 70 85 90 95)

3. To put this array into ascending order: 80 90 70 85 60 40 150 295, we need ___ rounds using a radix sort

A. 1

B. 2

C. 3

D. 4

4. Sort the array: 5 7 4 9 8 6 3 into ascending order by using a bubble sort. What will the array look like after the first swap? (SHOW WORK)

A. 5 4 7 9 8 6 3

B. 5 7 4 9 8 3 6

C. 4 7 4 3 8 6 9

D. 3 7 4 9 8 6 5

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1.
Mergesort algorithms requires the most extra space when implemented?
Answer:
B. Mergesort

2. 
Sort this array into ascending order: 80 90 70 85 60 40 50 95. Assume the pivot is 40
All elements less than 40 are on the left side (in the same order) and others are on the right side.
So, answer is () and (80 90 70 85 60 50 95)
Answer:
B. () and (80 90 70 85 60 50 95)

3. 
To put this array into ascending order: 80 90 70 85 60 40 150 295, we need 3 rounds using a radix sort
Max number of digits are 3.
So, answer is 3
Answer:
C. 3

4. 
Sort the array: 5 7 4 9 8 6 3 into ascending order by using a bubble sort. 
5 is less than 7, So, no swap needed.
7 is not less than 4. So, we have to swap 7 and 4.
the array look like after the first swap is 5 4 7 9 8 6 3
Answer:
A. 5 4 7 9 8 6 3
Add a comment
Know the answer?
Add Answer to:
1. Which of the following algorithms requires the most extra space when implemented? A. Quicksort B....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Sort the array of intergers into ascending order: 80 90 70 85 60 40 50 95....

    Sort the array of intergers into ascending order: 80 90 70 85 60 40 50 95. Assume 95 is the pivot. Show the two groups generated after the partition. O (80 90 70 85 60 40 50) and 0 O (40) and (50 60 70 80 85 90 40) O () and (50 60 70 80 85 90 40) O and (80 50 60 70 85 90 40)

  • soneoxderFor example: weotes 2. (15%) a) (5%) Given the following array [ 10, 5, 3, used to sort this array in ascending order select possible To 22, 24, 28, 27, 21 and assuming that Quicksort will b...

    soneoxderFor example: weotes 2. (15%) a) (5%) Given the following array [ 10, 5, 3, used to sort this array in ascending order select possible To 22, 24, 28, 27, 21 and assuming that Quicksort will be for the last element of the array 9 alue(S bysuch that the partitioning performed by Quicksort is most balanced Explain why this ae lstt elenern's makes Quicksort perform efficiently soneoxderFor example: weotes 2. (15%) a) (5%) Given the following array [ 10, 5,...

  • Java 1. (5) Assume selection sort is applied to the following array. Show the state of...

    Java 1. (5) Assume selection sort is applied to the following array. Show the state of the array after the first pass of the outer loop. 50 35 15 100 90 20 10 25 2. (5) Assume bubble sort is applied to the following array. Show the state of the array after the first pass of the outer loop 50 35 15 100 90 20 10 25 3. (5) Assume quicksort is applied to the following array. Show the state...

  • A set of data (test scores), can be summarized by a frequency distribution chart. For example,...

    A set of data (test scores), can be summarized by a frequency distribution chart. For example, if the list of test scores is: 90 85 100 50 50 85 60 70 55 55 80 95 70 60 95 80 100 75 70 95 90 90 70 95 50 65 85 95 100 65 then the frequency distribution chart looks like the one below: value           frequency ------           ------------ 100                3           95          ...

  • . Shell sort is a sorting algorithm similar to insertion sort. Research shell sort and apply...

    . Shell sort is a sorting algorithm similar to insertion sort. Research shell sort and apply that to the following array. Show your work in Detail. [15 points] 45 20 50 10 80 30 60 70 40 90 2. Is Shell sort a stable sorting algorithm? Answer this with an example. [10 points] 3. Apply Merge Sort to sort the following list. Show your work in Detail. [15 Points] 45 20 50 10 80 30 60 70 40 90 4....

  • PROBLEM #11 What are the two algorithms used to sort an array? How do they work?...

    PROBLEM #11 What are the two algorithms used to sort an array? How do they work? -------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------------------------- PROBLEM #12 Given the following array 'jumbled', what will the array be after the first swap of a selection sort algorithm? (Assume the algorithm sorts in ascending order). --------------------------------------------------------------------------------------------------------------- */ int jumbled[] = {12, 5, 3, 1, 9, 100, 45}; /* --------------------------------------------------------------------------------------------------------------- PROBLEM #13 Given the following array 'jumbled2', what will the array be after the third swap of a...

  • An article of the American Journal of Clinical Pathology, by Metz et al. (A-4) published the...

    An article of the American Journal of Clinical Pathology, by Metz et al. (A-4) published the comparison of three methods to determine the percentage of dysmorphic erythrocytes in the urine. They obtained the following results when using the A (X) and B (Y) methods in 75 urine samples. Draw a scatter diagram and obtain the regression equation and graph it on the diagram. X            Y            X            Y            X            Y            X            Y 0            0            20          16          65          55          89          81 0           ...

  • In the following table, highlight, circle, or otherwise mark (in the Quantity column please) the socially...

    In the following table, highlight, circle, or otherwise mark (in the Quantity column please) the socially optimal level of output. Quantity Price ($ per unit) Marginal Private Cost Marginal External Cost 0 100 0 0 1 95 10 5 2 90 20 10 3 85 30 15 4 80 40 20 5 75 50 25 6 70 60 30 7 65 70 35 8 60 80 40

  • (Quicksort) Here is an array which has just been partitioned by the first step of quicksort:...

    (Quicksort) Here is an array which has just been partitioned by the first step of quicksort: 3, 0, 2, 4, 5, 8, 7, 6, 9. Which of these elements could have been the pivot? (List all possibilities and explain your answers.)

  • Radix sort C++ Come up with an unsorted array of numbers (integer array). Sort the numbers...

    Radix sort C++ Come up with an unsorted array of numbers (integer array). Sort the numbers in ascending order and descending order and display them using radix sort. First sort in ascending, then reset the array to its original order and finally sort the array again in descending order. USE THIS STUCTURE struct nodeQ{                            node *front;                            node *rear;               };               nodeQ que[10]; enqueue(que[i],data); EXAMPLE: Original, unsorted list: [170, 45, 75, 90, 2, 802, 24, 66] 1ST PASS:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT