add a java sort algorithm code