Sorting with thread

Reply

Join Date: Nov 2008
Posts: 6
Reputation: soniagupta98 is an unknown quantity at this point 
Solved Threads: 0
soniagupta98 soniagupta98 is offline Offline
Newbie Poster

Sorting with thread

 
0
  #1
Jan 22nd, 2009
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()
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,444
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 510
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Sorting with thread

 
0
  #2
Jan 22nd, 2009
You should have very little code at all in main() - the majority of it should be in separate classes and methods.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 53
Reputation: neilcoffey will become famous soon enough neilcoffey will become famous soon enough 
Solved Threads: 6
neilcoffey neilcoffey is offline Offline
Junior Poster in Training

Re: Sorting with thread

 
0
  #3
Jan 23rd, 2009
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC