public StrList returnSort() { StrList returnList = new StrList(); //int length = end; for (int i = 0, loop = end; i <= loop; i++) { int leastIndex = 0; for (int j = 0; j <= end; j++) { if (makeNameCode(getAt(j)) < makeNameCode(getAt(leastIndex))) { leastIndex = j; } } returnList.add(getAt(leastIndex)); delAt(leastIndex); } return(returnList); }
public StrList yuckSort() { StrList returnList = new StrList(); for (char i = 'a'; i <= 'z'; i++) { for (char j = 'a'; j <= 'z'; j++) { for (char k = 'a'; k <= 'z'; k++) { for (int x = 0; x <= end; x++) { if (getAt(x)[0] == i && getAt(x)[1] == j && getAt(x)[2] == k) { returnList.add(getAt(x)); } } } } } return(returnList); }