updated SortGreedy.java