code: private static void setExtendedParentPointers(final int[] array) {
          final int length = array.length;
          array[0] += array[1];
  
          for (int headNode = 0, tailNode = 1, topNode = 2; tailNode < length - 1; tailNode++) {
              int temp;
              if (topNode >= length || array[headNode] < array[topNode]) {
                  temp = array[headNode];
                  array[headNode++] = tailNode;
              } else {
                  temp = array[topNode++];
              }
  
              if (topNode >= length || (headNode < tailNode && array[headNode] < array[topNode])) {
                  temp += array[headNode];
                  array[headNode++] = tailNode + length;
              } else {
                  temp += array[topNode++];
              }
              array[tailNode] = temp;
          }
      }
docs: Fills the code array with extended parent pointers.
  @param array The code length array