Question
Create a new Java Application to manage Linked Lists: (Note: Do not use java.util.LinkedList) a) Create a DateTime class 1. Add day, month, year, hours,
Create a new Java Application to manage Linked Lists: (Note: Do not use java.util.LinkedList) a)
Create a DateTime class
1. Add day, month, year, hours, minutes as attributes
2. Add a constructor and a toString() method
3. Implement the Comparable interface, and add a CompareTo() method
4. Add methods to get and set all attributes.
b) Add to MyLinkedList class the following methods:
1. Insert a Node to a particular position in the List
2. Insert a Node in place, assuming that the list is ordered in ascending order.
3. Delete node in front
4. Delete last node
5. Delete a node given its position
6. Method to find the node with the minimum value in the list getMinimum()
7. Method to merge two lists together and return the resulting linked list
8. Sort list in ascending order
9. Sort list in descending order
c) Create a Test3 class to do the following in the main method:
1. Create a new List (call it dateTimeList) of type MyLinkedList
2. Insert five DateTime objects numbers to a specific position in the list (not ordered).
3. Display all the DateTime objects in the List
4. Display the DateTime objects occurring after today
5. Insert a new DateTime elements to its appropriate position in the List and display it
6. Sort the List and display it in both ascending and descending
7. Display the smallest and the largest elements in the list
8. Display all DateTime objects with the time in the afternoon
9. Delete a DateTime object from the front of the list
10. Delete a DateTime object from the back of the list
11. Create two lists of DateTime objects, merge them together, and then print the resulting merged list.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started