public static Integer radixSort(int[] a) {
		// 
		Integer n = 0;
		int max = 0;
		for (int i = 0; i < a.length; i++) {
			n++;
			if (a[i] > max) max = a[i];
		}
		
		int tenBase = 1;
		
		while (max/tenBase > 0) {
			int[] bucket = new int[10];
			
			for (int i = 0; i < a.length; i++) {
				n++;
				bucket[a[i]/tenBase%10]++;
			}
			System.out.println("Max = " + max + "; bucket: "+Arrays.toString(bucket));
			
			for (int i = 1; i < 10; i++) {
				n++;
				bucket[i] += bucket[i-1];
			}
			System.out.println("Max = " + max + "; bucket: "+Arrays.toString(bucket));
			
			for (int i = 9; i > 0; i--) {
				n++;
				bucket[i] = bucket[i-1];
			}
			bucket[0] = 0;
			System.out.println("Max = " + max + "; bucket: "+Arrays.toString(bucket));
			
			int[] b = new int[a.length];
			for (int i = 0; i < a.length; i++) {
				n++;
				b[bucket[a[i]/tenBase%10]] = a[i];
				bucket[a[i]/tenBase%10]++; //move index of current digit more more place
			}
			
			for (int i = 0; i < a.length; i++) {
				n++;
				a[i] = b[i];
			}
			
			tenBase *= 10;
		}
		
		return n;
	}