code: @LinearTime
      public static <K> BinaryArrayBulkInsertWeakHeap<K> heapify(K[] array, Comparator<? super K> comparator) {
          if (array == null) {
              throw new IllegalArgumentException("Array cannot be null");
          }
          if (array.length == 0) {
              return new BinaryArrayBulkInsertWeakHeap<K>(comparator);
          }
  
          BinaryArrayBulkInsertWeakHeap<K> h = new BinaryArrayBulkInsertWeakHeap<K>(comparator, array.length);
  
          System.arraycopy(array, 0, h.array, 0, array.length);
          h.size = array.length;
  
          for (int j = h.size - 1; j > 0; j--) {
              h.joinWithComparator(h.dancestor(j), j);
          }
  
          return h;
      }
docs: Create a heap from an array of elements. The elements of the array are
  not destroyed. The method has linear time complexity.
  
  @param <K>
  the type of keys maintained by the heap
  @param array
  an array of elements
  @param comparator
  the comparator to use
  @return a binary heap
  @throws IllegalArgumentException
  in case the array is null