Hi i am trying to create a game of scrabble using several different interfaces. I am currently working on the board, and am wanting to sort the words which are put on the board in alphabetical order. I have attempted to do this by mergesort but its not working and i cant work out why. Here is my code. Can anyone tell me where i am going wrong? And how i can change it to correct it? Many thanks
/* * This method merges each half of the arrays in to an *alphabetical order */
private static void merge(String words[], String temp[], int low, int middle, int high)
{ int ri = low; int ti = low; int di = middle;
while (ti < middle && di <= high) { if ( words.length < temp.length) words[ri++] = words[di++];