Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By Ronin

Thread: Shell Sort Help

  1. #1
    ChrisChan is offline Member
    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Default 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

    thanks in advance guys :D

  2. #2
    Ronin is offline Senior Member
    Join Date
    Oct 2010
    Posts
    393
    Rep Power
    5

    Default Re: Shell Sort Help

    Quote Originally Posted by ChrisChan View Post
    Create a Java program with the following requirements...
    Ok, done..... Oh wait! Was this a question?
    SurfMan likes this.

  3. #3
    Ronin is offline Senior Member
    Join Date
    Oct 2010
    Posts
    393
    Rep Power
    5

    Default Re: Shell Sort Help

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

    Regards.

  4. #4
    ChrisChan is offline Member
    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Default Re: Shell Sort Help

    well im stuck at sorting

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,662
    Blog Entries
    7
    Rep Power
    21

    Default Re: Shell Sort Help

    Quote Originally Posted by ChrisChan View Post
    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
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Shell Sort errors HELP!
    By MDK231 in forum New To Java
    Replies: 4
    Last Post: 12-11-2011, 10:24 PM
  2. Replies: 1
    Last Post: 10-10-2011, 04:51 PM
  3. shell sort
    By fam2315 in forum New To Java
    Replies: 11
    Last Post: 08-24-2011, 12:32 AM
  4. Hibbard's Shell Sort
    By biglandphil in forum New To Java
    Replies: 2
    Last Post: 11-12-2009, 08:38 PM
  5. Shell Sort in Java
    By Java Tip in forum Algorithms
    Replies: 0
    Last Post: 04-15-2008, 07:44 PM

Posting Permissions

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