Implement an instance method, called getFirstHalf, that belongs to yourThingLinkedBag. The method returns as output a linked list that includes allvalues in the first half of the bag's linked list. For example, for the following bag3-->5-->8-->9. the method returns 3-->5.If the bag includes an odd number of nodes, then the middle element belongs tothe first half and is included in the output.Make sure to include the methodheader. The bag should remain unchanged (i.e., do not remove the returnedvalues from the bag).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here