954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Sorting with thread

hey can any one help me in writing the code :
Write a Java program that sorts given integers using threads

I am not able to proceed ..What should i have in main function()

soniagupta98
Newbie Poster
6 posts since Nov 2008
Reputation Points: 7
Solved Threads: 0
 

You should have very little code at all in main() - the majority of it should be in separate classes and methods.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

I assume that "by threads", the assignment means sorting with several threads in parallel. So you need to:
- know how to program with threads in Java
- pick an algorithm that can be parallelised. This essentially means one that uses a "divide and conquer" strategy to work on different parts of the list and then amalgamate the results. Take a look at the Quicksort algorithm , for example.

neilcoffey
Junior Poster in Training
53 posts since Dec 2008
Reputation Points: 120
Solved Threads: 7
 

neilcoffey thank you, i have same thougth, will answer by results

finfort
Newbie Poster
1 post since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You