I am writing a genetic algorithm and need to sort strings based on their fitness score. Both elements are saved in a single column, and two rows of an array like the following.
static String[][] guessArray = new String[2][popSize];
guess: | qwery | asdfg |
score: | 4 | 2 |
The above is a 2d array of strings that saves the guesses and their fitness scores. I need to sort both rows based on the scores in the bottom row. Previous posts have not answered this question (thank you to the mod for the link in my last post).
EDIT: Currently working on using an object and object array to do this.
EDIT2: This doesn't mean that I have found a solution.
Many thanks!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…