code: @LinearTime
      public static <K, V> DaryArrayAddressableHeap<K, V> heapify(int d, K[] keys, V[] values,
              Comparator<? super K> comparator) {
          if (d < 2) {
              throw new IllegalArgumentException("D-ary heaps must have at least 2 children per node");
          }
          if (keys == null) {
              throw new IllegalArgumentException("Keys array cannot be null");
          }
          if (values != null && keys.length != values.length) {
              throw new IllegalArgumentException("Values array must have the same length as the keys array");
          }
          if (keys.length == 0) {
              return new DaryArrayAddressableHeap<K, V>(d, comparator);
          }
  
          DaryArrayAddressableHeap<K, V> h = new DaryArrayAddressableHeap<K, V>(d, comparator, keys.length);
  
          for (int i = 0; i < keys.length; i++) {
              K key = keys[i];
              V value = (values == null) ? null : values[i];
              AbstractArrayAddressableHeap<K, V>.ArrayHandle ah = h.new ArrayHandle(key, value);
              ah.index = i + 1;
              h.array[i + 1] = ah;
          }
          h.size = keys.length;
  
          for (int i = keys.length / d; i > 0; i--) {
              h.fixdownWithComparator(i);
          }
  
          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 <V>
  the type of values maintained by the heap
  @param d
  the number of children of the d-ary heap
  @param keys
  an array of keys
  @param values
  an array of values, can be null
  @param comparator
  the comparator to use
  @return a d-ary heap
  @throws IllegalArgumentException
  in case the number of children per node are less than 2
  @throws IllegalArgumentException
  in case the keys array is null
  @throws IllegalArgumentException
  in case the values array has different length than the keys
  array