Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

I would like some advice please. I have to create a Java program

 
Raj's Avatar
  • Answered by:Raj
  • Computer Engg.
  • Positive Feedback: 98.8 %
  • Accepted Answers: 856
Verified Expert
in Programming

Recent Feedback

Positive
Excellent work and exactly what I needed..Thanks!
Positive
Thank you Raj exactly what I am looking for can I ask for your help in the...
Positive
Great job!
Positive
Very knowledgeable. Explains everything, if you're struggling with an assignment...
Positive
Thanks
Positive
Thanks
Positive
Raj did the job fast an accurately!
Positive
Raj helped me quickly and taught me alot.
Positive
RAJ is great as always!

Customer Question

I would like some advice please. I have to create a Java program that has three types of sorts - Quicksort, Shell Sort and Bubble sort. I have to run these sorts on 5 different sized arrays, with a complete, partial and random array. I also have to make visualization applets.

 

Optional Information:
Language (or Software): Other

Already Tried:
Right now I'm trying to figure out the logic of everything to start writing the program. I want to make sure I'm on the right track.

Submitted: 380 days and 14 hours ago.
Category: Programming
Value: $45
Status: CLOSED
Picture
Expert:  Raj replied380 days and 14 hours ago.

Hello and welcome to JustAnswer. I look forward to assisting you today with your question and providing the best answer possible.

Hi there,

I can help you with simole console based codes for all three sorting methods for arrays.
I will not be able to help with visualization applet.
Will that be fine with you?

Customer replied380 days and 14 hours ago.

Anything to get started would be helpful.

Picture
Expert:  Raj replied380 days and 14 hours ago.

Ok by when do you need the code?

Customer replied380 days and 14 hours ago.

Is tomorrow too soon? I can copy all of the directions to you? I don't want you to do the assignment - just to get me started with the logic and the code....

Picture
Expert:  Raj replied380 days and 14 hours ago.

Yes post the complete assignment here and I will help you to get started with it.

Customer replied380 days and 14 hours ago.

The three sorts I have are Quicksort, Shell Sort and Bubble Sort.


Unit 3 Final Project Description

Sorting is a fundamental topic in Computer and Information Science. Due to the pervasiveness of the topic, there are a number of standard algorithms that people choose when a sort is required. As with any set of solutions to a problem, there are advantages and disadvantages of each.

The purpose of this project is to expose you to various sorting techniques, while at the same time allowing you to study the characteristics of those techniques that make them advantageous (or disadvantageous) to use.

Instructions:

Design an OO framework that will allow you to study multiple sorts. All of the objects in the sorting framework will need to sort the same array of data and time the results. After you have run your program on data with different characteristics, you will need to write a report detailing your results.

To see how well the sorts work, you must sort arrays of varying sizes. These sizes are: 10 elements, 50 elements, 100 elements, 500 elements, and 1000 elements. For each of these array sizes, you will have to use one array that is already sorted, another array that is partially sorted, and one that is random. Create a table containing the runtime of each of the sorts when sorting these combinations. The following table provides an example of the test runs you will need to make for each sort:

# XXXXX

Fully
Sorted

Partially
Sorted

Random

10

 

 

 

50

 

 

 

100

 

 

 

500

 

 

 

1000

 

 

 

Deliverables:

1. Due in Unit 4: An OO program that implements Quicksort and two other sorts. One should have a worst case time of O(n2), and the other can be any sort of your choice. (Note: as a starting point, see http://en.wikipedia.org/wiki/Sorting_algorithm ).

2. Due in Unit 5: A paper describing the sorts you implemented and your results. Please site any references using APA.

Grading Scale for Final Project:

Program compiles correctly with appropriate output:
100 points
Paper: 100 points

Extra Credit:

Visualizing solutions is a powerful tool for learning. For extra credit, anyone who can visualize the sorts in progress will receive an additional 20%. Examples of these visualizations will be provided to you.

© ECPI, 2012

Picture
Expert:  Raj replied380 days and 14 hours ago.

Ok got your question.

Now what kind of help you need in this.
I mean you need to understand how this sorting takes place?
OR
you need code for all three kind of sorting?
OR
you need the complete code implementing all three sorting mentioned?

Customer replied380 days and 14 hours ago.

I need to figure out how to lay it all out and get started with the code. I asked my professor questions, and basically, from what I understand I need to create a abstract super class that has each of the sorts as a subclass and the arrays under that. I'm not quite sure how the sort needs to take place in Java.

Picture
Expert:  Raj replied380 days and 14 hours ago.

Ok i will explain you everything what he ment but can I help you by tomorrow morning.
Will that be fine with you?

Customer replied380 days and 14 hours ago.

Yes. I actually will not be home from work until about 8:00 PM EST. Will you be online then?

Picture
Expert:  Raj replied380 days and 13 hours ago.

Dont worry i will keep the explaination ready by than for you along with the base which you can use for your java code.

I would like to ask do you know how to compile multifile programs in your compiler?

Customer replied380 days and 13 hours ago.

Yeah - I just type the following import.model.filename;

Correct?

FYI - I am using Eclipse as my IDE.

Picture
Expert:  Raj replied380 days and 13 hours ago.

No not like that.
Its like when you create a project and put many. Java files in it. And one java file contains main method which we use to run and get the output part.

Anyways if you have problem with multifile than no problem i will provide help by implementing all the class ij simple. Java file. As oer your convineance.

Customer replied380 days and 13 hours ago.

I do know how to create packages and classes and things. I also know how to kind of create the main program and get the output.

Picture
Expert:  Raj replied380 days and 9 hours ago.

Ok than, because you know the above parts, half the work is already dine.

Have a Good Day.

Customer replied379 days and 16 hours ago.

I am home from work now - were you able to put something together for me?

Picture
Expert:  Raj replied379 days and 12 hours ago.

Yes I have the document in MS Word file.
Do let me know when you are online.

Picture
Expert:  Raj replied379 days and 4 hours ago.

Ok,
As I told you I will be preparing an document explaining how the three asked sorting methods work along with the code.

So, Please download the document prepared along with the function for the sort from link below:
http://www.mediafire.com/?gducvzemboo49i8

----------------------------------------------------------------------------------------------------------------
If solution provided by me is satisfactory than don't forget to hit the GREEN ACCEPT Button because thats how we get paid for our efforts.
Positive Feedback and BONUS are always appreciated.
Thank You and Have a Good Day.
----------------------------------------------------------------------------------------------------------------

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and Accept my answer. I can address follow up questions at no extra charge and I’m always here to help. Thank you for using JustAnswer!

Customer replied378 days and 16 hours ago.

Thank you for the information. If you are online and available, please let me know as I have a question about the information.

Thank you.

Picture
Expert:  Raj replied378 days and 16 hours ago.

Yes I am Online.

You can ask now?

Customer replied378 days and 16 hours ago.

Yes, can we chat for a few minutes. It would be faster.

Picture
Expert:  Raj replied378 days and 16 hours ago.

We can't chat now because it is possible only when you start a new Question.

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and Accept my answer. I can address follow up questions at no extra charge and I’m always here to help. Thank you for using JustAnswer!

Customer replied378 days and 16 hours ago.

Oh, I wasn't aware you could only chat with a new question. I appreciate the code that you sent. With the questions in mind, there are actually 45 total sorts to this problem. Is there a way to write one bubblesort that runs through all of the different parameters for the array size and the variations on the sorting mechanisms?

Picture
Expert:  Raj replied378 days and 16 hours ago.

Yes,

If you will see the function i provided for bubblesort.
You can specify the size of n as size of array or uptill which you want to sort.

like suposse if i have an array of size 10 i will send n value as 10
If i have array of size 100 i will send n value as 100
If i have array of size 100 but i want to sort only first 20 than i will send n as 20.

Was I able to make you understand your requirement??

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and Accept my answer. I can address follow up questions at no extra charge and I’m always here to help. Thank you for using JustAnswer!

Customer replied378 days and 16 hours ago.

So for each size array I have to do another subclass with a different name, and the same thing for each one of the ways I want to sort? The directions specify, "These sizes are: 10 elements, 50 elements, 100 elements, 500 elements, and 1000 elements. For each of these array sizes, you will have to use one array that is already sorted, another array that is partially sorted, and one that is random."

So for the Bubblesort - I will have the same code 15 times, just changing the numbers of the array size, and qualifying whether or not it is already sorted, partially sorted, or random?

Picture
Expert:  Raj replied378 days and 16 hours ago.

No you are getting it wrong.

First of all code will be same for all so Code apperiance will be only Once.

The size will be decided only when you call the function.
And since function is not working for any fixed size and can work for any size specified as n.

So Code will be once and if to be run for 15 variables/arrays than code will be called 15 times.

Got it?

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and Accept my answer. I can address follow up questions at no extra charge and I’m always here to help. Thank you for using JustAnswer!

Customer replied378 days and 16 hours ago.

Ok, so I use the main program to call the different sorts the 15 times?

Accepted Answer

Picture
Expert:  Raj replied378 days and 16 hours ago.

Yes Perfect.
I think you understood this time.

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and Accept my answer. I can address follow up questions at no extra charge and I’m always here to help. Thank you for using JustAnswer!

Expert TypeComputer Engg.
Category: Programming
Pos. Feedback: 98.8 %
Accepts: 856
Answered: 5/12/2012

Experience: BE CS, 4+ Experience in Programming and Database (ERP)

Ask this Expert a Question >
Customer replied378 days and 16 hours ago.

Ok, I'm going to accept your answer. I may have follow-up questions though. I hope you will be available for them.

Picture
Expert:  Raj replied378 days and 16 hours ago.

No Problem.
Even if I am not online in future leave here the message or problem and I will reply as soon as possible for me.

Customer replied378 days and 16 hours ago.

Thank you!

Picture
Expert:  Raj replied378 days and 16 hours ago.

You are welcome

Customer replied377 days and 22 hours ago.

Hi, please let me know if you are arround. I have an error in the code that I can't get rid of and I'm having difficulty figuring out how to call the sorts into my main program.

Thank you.

Picture
Expert:  Raj replied377 days and 22 hours ago.

yes i am around.
post the code you have done yet using www.wikisend.com

Customer replied377 days and 22 hours ago.

Ok - The code in the MasterSort class is there because I'm want to keep the output stuff something similar. I don't know how to start calling all the different levels of the arrays and the Quicksort one has an error.

Customer replied377 days and 22 hours ago.

Did you get it? http://wikisend.com/download/485008/FinalProject.zip

Picture
Expert:  Raj replied377 days and 22 hours ago.

Ok
I will give you a sample code describing you how to implement quicksort in your program.

please download the sample code for the code i provided you containing quicksort algorithm implementation.
http://wikisend.com/download/486524/Sorting.java

Read carefully the coments I have written in Main Function at the end.

Customer replied377 days and 22 hours ago.

Thank you. I will play with everything and see what I can do.

Picture
Expert:  Raj replied377 days and 22 hours ago.

Ok Thats Great.

Have fun with coding.

Have a Good Day.

Customer replied377 days and 12 hours ago.

Hi Raj - are you around? I have one final thing that is needed. I actually have to time the sorts, and I'm not sure how to do that.

Picture
Expert:  Raj replied377 days and 9 hours ago.

Actually i am travelling so will be helping you when i reach back home.

Customer replied377 days and 4 hours ago.

Ok - let me know when you are back and I will send you my code.

 
Tweet

5 Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
For The Doctor ONLY - Please fix the Doe Valley town Meeting 5/18/2013
Scenario: 5/17/2013
I need help with my website, I put in the Infolink ad code 5/17/2013
Microsoft Visual Basic 2010 Programming Exercise 5/16/2013
I am programming and auto reply macro and Outlook 10 that is 5/16/2013
Hello. I really need help with C Programming. I need a program 5/15/2013
I need to make the submit button bigger 5/15/2013
"For Jatechexpert" Part 1Programming Exercise 2—Calories 5/14/2013
INSTRUCTIONS: VERY IMPORTANT, THIS IS TO BE DONE USING MICROSOFT 5/13/2013
I have a JavaScript programming question. I have a form and 5/13/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

JustAnswer in the News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
165 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us | Our Network
© 2003-2013 JustAnswer LLC
  • Pearl.com
  • JustAnswer UK
  • JustAnswer Germany
  • JustAnswer Spanish
  • JustAnswer Japan