code a program in Java to implement the min-priority queue using…

Question Answered step-by-step code a program in Java to implement the min-priority queue using… code a program in Java to implement the min-priority queue using the min-heap data structure. Implement the min-heap data structure using a String array of 5 cells. (Do not use Java in-built PriorityQueue class.) [In a min-heap, the root node and the intermediate node values are always smaller than their children.] First, take 5 names (array) from the user and insert them in the min-priority queue. Then print the elements of the queue. After that, delete two elements from the queue and print them. You can use Java Scanner class to take inputs from the user.The sample inputs/ outputs are given below: Sample inputs and outputs: (User’s inputs are shown in bold) /// prompt user to Enter 5 names: /////user enters element (it can be in form of one after the other or at once by separating with a ,)// Enter 5 names: Harris, Eve, Alice, Bob, EvaOutput printThe elements of the min-priority queue: Alice, Bob, Eve, Harris, EvaThe name removed after first deletion: AliceThe name removed after second deletion: BobThe elements of the min-priority queue: Eva, Harris, Eve  Computer Science Engineering & Technology Java Programming EECS 092 Share QuestionEmailCopy link Comments (0)