TopcoderArchiveVisit Topcoder
Archive
Algorithm problem

StringList

Problem statement, definition, constraints, and public examples.

Problem Statement

Create a class StringList that contains the method alphabetize, which takes an
ArrayList of Strings as an argument and returns an ArrayList of those Strings
alphabetized. You may assume that these Strings can only contain the 52
alphabetic characters. Also, to be consistent with the way computers
alphabetize, all capital letters come in alphabetical order before all lower
case letters. Therefore, ""Zebra"" would precede ""apple"" in this case. Trust
us when we say it's easier this way.

ArrayList.get(i) will get the ith element of an ArrayList
ArrayList.add(Object) will add the object to the end of the ArrayList
ArrayList.remove(i) will remove the ith element and shift accordingly
ArrayList.set(i, obj) will set the ith element to obj

Definition

Class:
StringList
Method:
alphabetize
Parameters:
ArrayList
Returns:
ArrayList
Method signature:
ArrayList alphabetize(ArrayList param0)
(be sure your method is public)

Constraints

    Examples

      No public sample cases were explicitly marked for this problem in the original data.

      Back to all problems