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
Selection-Sort( A[1..n] ) 1 2 3 4 5 6 7 8 9 10 // INPUT: A[1..n],...
Selection-Sort( A[1..n] ) 1 2 3 4 5 6 7 8 9 10 // INPUT: A[1..n], an array of any n numbers in unknown order integer i, j, m fori=1ton−1 do swap A[i] ↔ A[m] // OUTPUT: A[1..n], its numbers now sorted in non-decreasing order m=i for j = i to n do if A[j] < A[m] then m = j Give a proof that this algorithm sorts its input as claimed.
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
Given this array: int sequence[10] = { 3, 4, 5, 6, 7, 8, 9, 10, 1,...
Given this array: int sequence[10] = { 3, 4, 5, 6, 7, 8, 9, 10, 1, 2 }; Write a C++ program to ask the user to enter a number, if the number can be found in the array, your program should display "Found". Otherwise, your program should display "Not found". For example, if the user enters 7, your program should display "Found". If the user enters 11, your program should display "Not found".
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.
Consider the following array: int[] a = { 3, 5, 2, 2, 4, 7, 0, 8,...
Consider the following array: int[] a = { 3, 5, 2, 2, 4, 7, 0, 8, 9, 4 }; What are the contents of the array a after the following loops complete? (show how you arrive at the answer) a) for (int i = 1; i < 10; i++) { a[i] = a[i - 1]; b) for (int i = 9; i > 0; i--) { a[i] = a[i - 1]; }
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...
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