Question

Given the following unordered array: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]...

Given the following unordered array:

[0]

[1]

[2]

[3]

[4]

[5]

[6]

[7]

[8]

[9]

[10]

W

X

D

T

P

N

R

Q

K

M

E

If the array was being sorted using the SHELL sort and the halving method,

and sorting into ASCENDING order as demonstrated in the course content,

list the letters in the resulting array, in order AFTER the FIRST pass.

[0]

[1]

[2]

[3]

[4]

[5]

[6]

[7]

[8]

[9]

[10]

Homework Answers

Answer #1

In pass1,

Each sublist q starts with index 0 and it has elements at index 0,(0+5).

Next sublist has elements with index 1, (1+5).

Similarly all sublists have such elements till all elements are entered into sublists.

Then,

In each sublist, elements are sorted in ascending. After sorting elements in each sublist, finally all elements are traced from each index. Hence we get elements after pass 1 as shown below.

Thank you.

Know the answer?
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
Similar Questions
How do you take an array for example A = [4 6 7 1 2 5]...
How do you take an array for example A = [4 6 7 1 2 5] and sort it from ascending order. So it would output A = [1 2 4 5 6 7]. In MATlab without using the sort function as well.
Giving an array of integers A[1:8] ={5, 1, 3, 2, 7, 6, 8, 4}. Build a...
Giving an array of integers A[1:8] ={5, 1, 3, 2, 7, 6, 8, 4}. Build a MAX-HEAP on A. Show the steps using binary tree representation or array view. Use heap sort: show the array after the first, the second, and the third of heap sort
Let p = (8, 10, 3, 11, 4, 0, 5, 1, 6, 2, 7, 9) and...
Let p = (8, 10, 3, 11, 4, 0, 5, 1, 6, 2, 7, 9) and let q = (2, 4, 9, 5, 10, 6, 11, 7, 0, 8, 1, 3) be tone rows. Verify that p = Tk(R(I(q))) for some k, and find this value of k.
Pair 1 2 3 4 5 6 7 8 9 10 Medication 7 8 9 5...
Pair 1 2 3 4 5 6 7 8 9 10 Medication 7 8 9 5 6 7 7 8 8 7 Placebo 5 5 7 6 8 7 5 9 3 7 (Note: If you’re going to subtract, choose the order medication - placebo.) A sample of patients with similar weight and age characteristics were put in pairs. One patient in the pair was given medication while the other patient was given a placebo. After a month patients were...
This program is in C++, And please consider " sort pass #" for the output: Write...
This program is in C++, And please consider " sort pass #" for the output: Write a program that uses two identical arrays of eight integers. It should display the contents of the first array, then call a function to sort it using an ascending order bubble sort, modified to print out the array contents after each pass of the sort. Next the program should display the contents of the second array, then call a function to sort it using...
A:  8   6   5   8   9   5   3   7   9   3   5   7   9   3   6   4  ...
A:  8   6   5   8   9   5   3   7   9   3   5   7   9   3   6   4   5   8   5   3   9 B:  3   7   9   3   5   7   9   6   8   3   5   9   6   7   8   3   7   9   5   2   8 C:  5   9   6   7   8   3   7   9   5   2   8   8   6   5   8   9   5   4   7   8   5 Using the data from the Production Run Population table what type of graph is not appropriate to...
Question 4: (20 marks) Given the following numbers found in an array: 8, 7, 1, 4,...
Question 4: Given the following numbers found in an array: 8, 7, 1, 4, 3, 9 Use insertion sort to sort the original list of numbers. Use bubble sort to sort the original list of numbers.   
Stem Leaf 2 6 3 0, 7 4 0, 2, 6 5 1, 5, 7, 9,...
Stem Leaf 2 6 3 0, 7 4 0, 2, 6 5 1, 5, 7, 9, 9 6 0, 2, 5, 8 1) standard deviation: 2)Find Five-number summary of the data set 3). Draw a box plot that represents the data set
Pain before treatment Pain after treatment 9 8 5 6 6 4 4 3 3 3...
Pain before treatment Pain after treatment 9 8 5 6 6 4 4 3 3 3 10 8 9 6 9 7 7 8 5 4 2 4 5 4 8 5 3 5 6 3 7 8 ⦁ Paste SPSS output. (6 pts) ⦁ Write an APA-style Results section based on your analysis. Include your graph as an APA-style figure as demonstrated in the APA writing presentations. (Results = 6 pts; Graph = 4 pts)
Consider the following data: 6, 8, 2, 3, 4, 4, 5, 5, 9, 6, 6, 7,...
Consider the following data: 6, 8, 2, 3, 4, 4, 5, 5, 9, 6, 6, 7, 7 ,7, 7, 8, 8, 8, 8, 9, 9. What type of distribution is this?