title: Divide an uneven number between Threads
body: <p>I am just learning Threads in Java and I want to sort a list of words alphabetical. My program read the words of a txt-file and put them in a String-array. The user can choose how many threads they want to use themselves. I want to split the array in even (as possible) chunks that the threads can sort by themselves.</p>
  
  <p>So to my question:</p>
  
  <p>How can I split the array.length as even as possible across the threads? My mind is blanking and I can't think of a smart way to do this.</p>
  
  <p>e.g: If I have a array.length of 22 and 4 threads, how can give the threads in this case; 6, 6, 5 and 5 sized pieces of the array? Needs to be applicable to every number given.</p>
  
  <p>I tried to explain it the best I could, please ask if something was unclear! Thank you!</p>