Question: Consider Bag, SinglyLinked List, and DoublyLinkedLists classes for integers. Implement and test the following methods: 1. Write a method in Bag class for integers

Consider Bag, SinglyLinked List, and DoublyLinkedLists classes for integers. Implement and test the following methods: 1. Write a method in Bag class for integers that finds the number of odd and even numbers in the list. 2. Write a method in SinglyLinked List class that prints the last three elements of the list. 3. Write a method in SinglyLinked List class that swaps the first and last nodes in the list. 4. Write a method in DoublyLinkedList class that prints all positive and negative integers of the list separately. 5. Write a method in Doubly Linked List class that swaps the first and last nodes in the list. 6. Write a Main class to test all these methods.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
