|
Informal Title: Linear List Processing Application
Date of Issue:
Refine the "unrefined code" in a manner consistent with the given constraints. Note that this code makes use of previously defined linear list processing classes.
|
init:
deps-jar:
compile-single:
run-single:
( aardvark ant bat cat dove elephant lion mouse rat tiger )
( January February March April May June July August September October November December )
( tiger rat mouse lion elephant dove cat bat ant aardvark )
( December November October September August July June May April March February January )
( 8.0 3.0 3.0 3.0 4.0 8.0 4.0 5.0 3.0 5.0 )
( 7.0 8.0 5.0 5.0 3.0 4.0 4.0 6.0 9.0 7.0 8.0 8.0 )
( 56.0 11.0 9.0 18.0 92.0 88.0 63.0 43.0 47.0 99.0 48.0 42.0 48.0 89.0 78.0 79.0 64.0 71.0 47.0 14.0 )
( 9.0 11.0 14.0 18.0 42.0 43.0 47.0 47.0 48.0 48.0 56.0 63.0 64.0 71.0 78.0 79.0 88.0 89.0 92.0 99.0 )
BUILD SUCCESSFUL (total time: 1 second)
|
package programs;
import datatypes.list.string.sequential.*;
import datatypes.list.numeric.linked.*;
public class LinearListApp {
public LinearListApp() {
}
public static void main(String[] args) {
StringLinearList animals = createAnimalList();
display(animals);
StringLinearList months = createMonthList();
display(months);
StringLinearList rv_animals = reverse(animals);
display(rv_animals);
StringLinearList rv_months = reverse(months);
display(rv_months);
NumericLinearList lengths_animals = lengths(animals);
display(lengths_animals);
NumericLinearList lengths_months = lengths(months);
display(lengths_months);
NumericLinearList number_list = createRandomNumberList(20);
display(number_list);
NumericLinearList ordered_number_list = sort(number_list);
display(ordered_number_list);
}
|