Question: Need help with the following problems B) Insertion Sort Sort 230 123 324 10 23 56 (6 items) using Insertion Sortand fill in the answers

Need help with the following problems

B) Insertion Sort

Sort 230 123 324 10 23 56 (6 items)

using Insertion Sortand fill in the answers below.

Step 1 Put pos 2 in X index:

  1. Which items were shifted to the right?
  2. How many element-element comparisons until X is deposited back?
  3. The resulting list is?

Step 2 Put pos 3 in X index:

  1. Which items were shifted to the right?
  2. How many element-element comparisons until X is deposited back?
  3. The resulting list is?

No need to do the rest of the steps.

4. Re-arrange the above 6 elements so that you would have made the worst number of comparisons:

C) Radix Sort

Sort 231 123 324 100 230 560 (6 items)

using Radix Sort.

Hint: Use 0-list, 1-list, 3-list, 4-list etc.

Pass1:

Show the sub-lists here based on the last char

Show the combined list

Pass2:

Show the sub-lists here based on the second char

Show the combined list

Pass3:

Show the sub-lists here based on the first char

Show the combined list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!