COSC 311 Homework 11/21/2016 Due: 11/28/2016 What is the oldest element in a minqueue? Construct a priority queue where the elements are ordered by decreasing data value. The lowest data value is at the root. When an element enters the system, it has a data value. When it is inserted to the priority queue, it is given a time stamp. The time stamp corresponds to the current time -- you can implement this with a counter, or you can use Java's Date cass. Only one element can be inserted to the priority queue at a time, so every element will have a unique time stamp. After inserting all elements to the priority queue, remove each element in proper order, keeping track of which is the oldest element. Only one element can be deleted at a time. Output the oldest data element and its age. Example: time action (timestamp) action 0 i 2 0 insert (2, ts=0) 1 i 4 1 insert (4, ts=1) 2 i 2 2 insert (2, ts=2) 3 i 5 3 insert (5, ts=3) 4 i 2 4 insert (2, ts=4) 5 d delete (2, ts=0) maxAge <- max(5 - 0, 0) 6 d delete (2, ts=2) maxAge <- max(6 - 2, 5) 7 d delete (2, ts=4) maxAge <- max(7 - 4, 5) 8 d delete (4, ts=1) maxAge <- max(8 - 1, 5) 9 d delete (5, ts=3) maxAge <- max(9 - 3, 7) The oldest element is data = 4, with age = 7 You must implement the priority queue code from scratch -- do not use any public Java API. You may implement the priority queue as a 1D array or as a dynamic data structure. You must implement your own Node class. Turn in: Hardcopy of your code. Hardcopy of test run on data: 1, 7, 3, 4, 5, 6, 1, 2, 3 In your code, include a header: [your name] [URL of code] COSC 311 HW 1121 FALL 2016. Do not supply UML diagram for your code.