1. Member
Join Date
Jan 2013
Posts
6
Rep Power
0

## Shell Sort Help

Create a Java program with the following requirements:

REQUIREMENTS:
create a one dimensional array, the size will be based on the answer in the "Enter the number of values to be inserted". Example: if the user inputted 8, that means you must create a one dimensional array with the size of 8.
prompt the user to input number (the number of input based on the answer in the "Enter the number of values to be inserted"). save the numbers inputted in your one dimensional arrray.
ask the user for the required N-sort. please note of the two rules in N-sorting under shellsort: (1) zero (0) is not valid N and (2) it can only be ranging from one (1) up to the half of the inputted number of elements. so if the number of elements is 8, that means the valid N is ranging from 1 to 4 only.
after the user inputted the valid value for N, display the numbers inputted earlier and stored in your one dimensional array.
implement the shellsorting afterwards.

OUTPUT:

Enter the number of values to be inserted: 8

Type a number: 8
Type a number: 7
Type a number: 6
Type a number: 5
Type a number: 4
Type a number: 3
Type a number: 2
Type a number: 1

Enter the required N-sort: 7
The N is either less than or more than the required N sort value.

Enter the required N-sort: 0
The N is either less than or more than the required N sort value.

Enter the required N-sort: 4

Current content of the 4-sorted:

8 7 6 5
4 3 2 1

Sorted content of the 4-sorted:

4 3 2 1
8 7 6 5

2. Senior Member
Join Date
Oct 2010
Posts
393
Rep Power
10

## Re: Shell Sort Help

Originally Posted by ChrisChan
Create a Java program with the following requirements...

3. Senior Member
Join Date
Oct 2010
Posts
393
Rep Power
10

## Re: Shell Sort Help

Please show us your attempt so far, what you have tried and what you are struggling with.

Regards.

4. Member
Join Date
Jan 2013
Posts
6
Rep Power
0

## Re: Shell Sort Help

well im stuck at sorting

5. ## Re: Shell Sort Help

Originally Posted by ChrisChan
well im stuck at sorting
Well, if you want sensible help better show us some of the relevant code (just the sort method will do fine).

kind regards,

Jos

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•