public static void bucketSort(int[] array, int rangeMin, int rangeMax) throws Exception {
		int[] bucket = new int[rangeMax-rangeMin+1];
		for(int i=0; i<array.length; i++) {
			if(array[i]>rangeMax || array[i]<rangeMin) {
				throw new Exception("Value in array out of range.");
			}
			
			bucket[array[i]-rangeMin]++;
		}
		
		for(int i=0, j=0; j<bucket.length;) {
			while(i<array.length&&bucket[j]-->0) {
				array[i++] = j + rangeMin;
			}
			j++;
		}
		
		System.out.println(Arrays.toString(array));
	}