
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about quiz 2 for the cmsc 132 course, including the quiz date, format, and covered topics. Students are required to complete several exercises related to implementing methods for a linkedlist class. The exercises cover creating an empty list, adding strings to the beginning and end, printing list elements, removing the last node, finding a string in the list, inserting a string before a target, and filtering the list based on string length. Solutions will not be provided, but students can discuss their answers with the ta or instructor during office hours.
Typology: Quizzes
1 / 1
This page cannot be seen from the preview
Don't miss anything!

The second quiz for the course will be on Monday, Feb 19, during your lab session. The following list provides more information about the quiz:
The following exercises cover the material to be included in this quiz. Solutions to these exercises will not be provided, but you are welcome to discuss your solutions with the TA or instructor during office hours. We strongly recommend you do not use Eclipse to write the code associated with these exercises. Try to answer the exercises in a piece of paper and then use Eclipse to verify your solutions. This approach will better prepare you for the quiz. You cannot use any Java API class (except String) during the implementation of the methods below.
Exercises
Implement the methods below based on the following Java class definitions.
public boolean insert(String entry, String target);
The method will look for the first instance of target in the list and will insert entry before that instance. The method will return true if a target instance is found and false otherwise. The list should not be modified if a target instance is not found.
public LinkedList filter(int maxLength);
The method will return a new LinkedList with nodes containing only strings that are shorter or equal to maxLength. The method should not modify the original list.