posted 12 years ago
I am not sure if this belongs here or in beginners. I have been working on this assignment for a while now and I can't figure this one issue out. I was given four files, Name.java, SortableArrayList.java, NameListDriver.java, and SortableArrayListWithBubbleSort.java. The program is meant to take a text file with a list of names and sort them alphabetically. Part one of the assignment was to change the bubble sort to a recursive selection sort. I seem to have completed that part. The second part requires me to make a driver that does the following things: Fill an array with random integers, output the array before sorting, then sort the array and output the sorted array. The size of the array is determined by a command line argument. It is supposed to be sorted by the same method that sorts the text file. I am able to create the array of random integers and output them, but I cant sort them.
Here is the randomDriver.java, which creates the array and outputs.
Now here is the SortableArrayListWithSelectionSortII.java that sorts the array. It works for the list of names, but not for the integers. It seems like the if (lowIndex < highIndex) statement isnt working for the array of integers.
Here is the SortableArrayList abstract class
It seems like the problem is with the first if statement in SortableArrayListWithSelectionSortII.java. It doesn't work with the bubble sort method that was originally supplied to me either. I am wondering if it might have to do with either variable names or data types? My sanity appreciates the help.
Please help me raise money to study abroad with Temple University in Tokyo, Japan. Please follow the link to donate. I appreciate any amount of money that you are willing to give. Any money donated will go ONLY towards tuition and program costs. Thank you again.
http://www.gofundme.com/22z71g