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:
- Which items were shifted to the right?
- How many element-element comparisons until X is deposited back?
- The resulting list is?
Step 2 Put pos 3 in X index:
- Which items were shifted to the right?
- How many element-element comparisons until X is deposited back?
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started