In this lab, you will add four methods to the LinkedIntList class
that we developed in class. The method signatures are:
public int peek(); public void exchange(); public int minElement(); public int maxElement(); The peek() method returns the data in the first node without modifying the list in any way. For example, if the list was
10 -> 20 -> 30 -> null Then peek() should return 10, leaving the list unchanged.
The exchange() method exchanges the values in the first two nodes. For example, if the list was
10 -> 20 -> 30 -> null before the call to exchange(), then afterward it looks like this:
20 -> 10 -> 30 -> null The minElement() and maxElement() methods return (respectively) the minimum and maximum element of the list.
321,403 students got unstuck by Course
Hero in the last week
Our Expert Tutors provide step by step solutions to help you excel in your courses