This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CountingSorter implements Sorter { | |
private final int maxValue; | |
public CountingSorter(int maxValue) { | |
this.maxValue = maxValue; | |
} | |
@Override | |
public int[] sort(int[] values) { | |
int[] counts = new int[maxValue + 1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package study.algorithm.telepathy.sort.quiz.problem1; | |
public class CountingSortBasedRankingService implements RankingService { | |
private final int maxScore; | |
public CountingSortBasedRankingService(int maxScore) { | |
this.maxScore = maxScore; | |
} | |
@Override |