Exercises
21.6 (Concatenating Lists) Write a program that concatenates two linked-list objects of characters. Class
ListConcatenateshould include astaticmethodconcatenatethat takes references to both list objects as arguments and concatenates the second list to the first list.21.7 (Inserting into an Ordered List) Write a program that inserts 25 random integers from 0 to 100 in order into a linked-list object. For this exercise, you’ll need to modify the
List<E>class (Fig.21.3 ) to maintain an ordered list. Name the new version of the classSortedList.21.8 (Merging Ordered Lists) Modify the
SortedListclass from Exercise21.7 to include amergemethod that can merge theSortedListit receives as an argument with theSortedListthat ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access