Implement a method to convert a max heap of strings stored


Implement a method to convert a max heap of strings stored in an array into a min heap. Reminder: in a max heap the priority value at any node is those at its children, while in a min heap, the priority value at any node is those at its children. The strings are by themselves priorities: if a string comes "before" another in alphabetical order, it is considered to be "less", and is of lower priority. The method returns a new array-the original array is NOT modified. Your method must be the fastest possible (big O wise). If it is not, you will get AT MOST HALF the maximum possible credit. You may define and fully implement helper methods as necessary. (Fully implemented means you may NOT "call" any method that you have not yourelf implemented here.)

// Converts a max heap (stored in an array) into a new min heap.

// Returns a new array that contains the min heap

// The input array is NOT modified

public static String[ ] convertMaxHeapToMin(String[ ] items) {

// IMPLEMENT THIS METHOD

 

Request for Solution File

Ask an Expert for Answer!!
Chemistry: Implement a method to convert a max heap of strings stored
Reference No:- TGS01196351

Expected delivery within 24 Hours