Question: JAVA Lab-Shellsort Part #1: Shells nt using Donald Shell's Suggested 8-4-2-1 Sequence Modify the shellsortdemo.java program to generate the sorting sequence found on p 276

JAVA JAVA Lab-Shellsort Part #1: Shells nt using Donald Shell's Suggested 8-4-2-1

Lab-Shellsort Part #1: Shells nt using Donald Shell's Suggested 8-4-2-1 Sequence Modify the shellsortdemo.java program to generate the sorting sequence found on p 276 of the text. The initial array is [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16 You will need to modify the code to generate an increment sequence of 8-4-2-1 Output should look something like this before: [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16] after [8] -sort: [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16] after [4]-sort: [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16] after [2]-sort: [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16] after [1]-sort: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] Part #2: Shellsort using an Alternate 7.5.3.1 Sequence Modify the shellsortdemo.java program to generate an increment sequence of 7-5-3-1. Use the same initial array 1, 9, 2,10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16 Output should look something like this before: [1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16] after [7]-sort: [1, 5, 2, 6, 3, 7, 4, 8, 9, 13, 10, 14, 11, 15, 12, 16 after [5] -sort: [1, 4, 2, 6, 3, 7, 5, 8, 9, 12, 10, 14, 11, 15, 13, 16] after [3] -sort: [1, 3, 2, 5, 4, 7, 6, 8, 9, 11, 10, 13, 12, 15, 14, 16] after []-sort: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]

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!