CSC 17 Lab 5 NOTE: additional problems may be added later ... Part 1: One can use the basic characteristics of a heap to implement a sorting algorithm as follows: 1. Given an array A of doubles, insert the elements one by one into the heap array. Don't confuse A, the array with the doubles to be sorted, and the array that implements the heap. Each insert takes lg(n) time and there are n elements, so this operation is n*lg(n). 2. Now, reconstruct the A array (backwards) by deleting the maximum element from the heap one by one. This will again take n(log n) time. A. Implement this algorithm, using the code for "dheap" found on the homepage. You can implement it as a function inside the intheap class as static void heapsort(double[] A) Call the function with a randomly generated array. Here's how to create a random array: double[] A = new double[n]; for (int i=0;i