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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!