Labs
In these labs we will use the List interface with implementation classes.
- Write a program that uses
Math.random()to build aListof10integers between10and100(inclusive) and prints them to the screen. - Choose whichever implementation class you want.
- Run it several times to see if you can get
10and100.
(Solution: NumbersList.java)
-
Add a
sortAndPrintListmethod, which takes aListofIntegers, sorts them, and prints the results. -
Don't try to develop a sort algorithm on your own, rather search the Internet for existing algorithms like bubble sort or insertion sort. If you have time, try multiple sort algorithms and be prepared to discuss the details of each with a partner.
(Solution: SortNumbersList.java)