betical order and are to be numbered 1, 2, and so on in the standard output stream. In alphabetical or dictionary order (unlike lexicographic order), case of a letter is considered only after the letter itself: b < B < c; and diacritic
JAVA Task, by using ArrayList
The program reads manatee names from the standard input stream and from time to time prints a sorted portion of the list of names. All the manatee names in the input are given in the order in which the necropsy was performed. You can imagine a unique timestamp associated with each necropsy. The names are not necessarily unique (many of the manatees have the same name). Interspered in the standard input stream are queries that begin with the question mark character. Queries ask for an alphabetical list of manatee names to be printed to the standard output stream. The list depends only on the names upto that point in the input stream and does include any manatee names that appear in the input stream after the query.
The list does not contain all the names of the previous necropsies, but only a selection of them. A query provides the names of two manatees, say A and B. The response to the query drops necropsies performed before the first named A and all the necropsies performed after the last one named B. In the response, the names are to be in alphabetical order and are to be numbered 1, 2, and so on in the standard output stream.
In alphabetical or dictionary order (unlike lexicographic order), case of a letter is considered only after the letter itself: b < B < c; and diacritics are likewise secondardy characteristics: u < ü < v
Read all input from the standard input stream. Write all output to the standard output stream. Manatee names do not contain white space. For each query a numbered list is printed, unless one or the other or both manatee are not found in the previous input. In which case, print the line "Not found".
In the case that both names are found, but the reponse is empty, print the line "Empty list".
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images