Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

Compute Paasches index for 2013 using 2000 as the baseperiod.

Answered: 1 week ago

Question

Discuss consumer-driven health plans.

Answered: 1 week ago