Results 1 to 6 of 6
  1. #1
    jvasilj1 is offline Member
    Join Date
    Jan 2008
    Posts
    36
    Rep Power
    0

    Default quicksort program

    hello guys, I am in deep and need some real help i need to create a program that does quicksort for class and i have no idea how to do it, can someone help me... here is what i need
    This programming assignment is to implement and compare the following sorting algorithms :

    1. quicksort (recursive version ) , use the median of three as the pivot element.
    2. quicksort (recursive version ), using median of three for pivot and switch to insertion sort when size of array is less than certain predetermined integer -- the cutoff size
    3. quicksort (non-recursive)
    4. mergesort recursive

    Java Generic must be used for each of the sorting method.



    You should use arrays instead of ArrayLists or LinkedList to store

    data.



    (I will test your sorting methods on arrays of different class of

    comparable objects, such as Double, Rational number etc .)



    Put all the sorting methods in one class ( Sort.java ).

    Do not package.



    You also have to provide Tester class that



    1. generates arrays of Integers of any given size .





    2. use each sorting method to sort the array and measure the

    running time for each case.



    3. You might also include other utility methods.

    You must submit the following:

    * All the Java source codes
    * Documentation that describes what you did, and how to run your program


    To run the program :



    Type the command : java Test1 10000
    Thank you to anyone who is going to help me i really appreciate it

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Unfortunately you don't really ask a specific question here, and so all I can do is refer you to a decent reference on the quicksort algorithm which you can find here: QuickSort At Wikipedia

    If this isn't enough to help, then you'd be best to do as much of this assignment as you can, and then come back with your code and a specific question regarding your code. Best of luck.

  3. #3
    jvasilj1 is offline Member
    Join Date
    Jan 2008
    Posts
    36
    Rep Power
    0

    Default

    thats the thing, i dont know anything about java and dont know how to write the code, can you help me put together the code to do the required parts of the homework?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Come on now. Asking others to do your homework is cheating. Surely you know better than to ask this. Please don't ask this again and I won't report you to the moderators. I strongly urge you to either talk to your teacher about arranging tutoring or consider dropping this class.
    Last edited by Fubarable; 03-03-2009 at 04:29 AM.

  5. #5
    jvasilj1 is offline Member
    Join Date
    Jan 2008
    Posts
    36
    Rep Power
    0

    Default

    ive already dropped a class this quarter and im on quarter away from graudating and this class is the only one holding me back, all i need is help with one assingment. a desperate student who cant afford to lose 2000 dollars for a class in java that he knows nothing about needs help thats all im asking, for help.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I'm afraid that your predicament is just that, your predicament. We can help you, but still it is your assignment and you must do it. You surely know a little Java, enough to get started at least setting up the problem, right?

    So break this problem down into small tasks, the smaller the better, and start working on each task. This sometimes easier to do by creating several small separate programs, then when each task is solved combining the parts into a whole. Then if you get stuck in any specific spot, come on back and ask a question. We'd be more than happy to help. But remember that specific answers will mainly come from specific questions.

    But what we cannot do, and what you should not ask is for anyone to write the assignment for you. I'm not sure that I can make it any more plain than that.

    Again, best of luck.

Similar Threads

  1. Execute A program from a Program!
    By Moncleared in forum Advanced Java
    Replies: 2
    Last Post: 02-22-2009, 05:17 PM
  2. Quicksort
    By little_polarbear in forum New To Java
    Replies: 12
    Last Post: 07-12-2008, 10:20 PM
  3. Executing a program within a program
    By gibsonrocker800 in forum New To Java
    Replies: 5
    Last Post: 05-12-2008, 09:24 AM
  4. Replies: 0
    Last Post: 04-04-2008, 03:40 PM
  5. Replies: 0
    Last Post: 10-04-2007, 10:33 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
  •