Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

merge sort

 
Maha Hassan
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All
I wonder how to implament merge sort using threads, i know that i will split the array till i have array of one element then start merging but i do not know how to write this in threads ..or how to ask the thread to return the sorted array..
anyhelp??
Maha
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start with the excellent Thread Tutorial from Sun to get the basics. You probably want something like:

Things to find in the tutorial ...

What does Thread.start() do?
What does Thread.join() do?
How do Runnable and Thread go together?

Does that answer the right question? Let us know how it goes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic