private int smallestChild( int parent ) {

    // see if the parent is actually a leaf
    if ( parent > ( size / 2 ) - 1 ) {
      return NO_CHILD;
    }

    // parent has at least one child
    int leftChild = 2 * parent + 1;
    int rightChild = leftChild + 1;

    // if parent has no right child, return left child
    if ( rightChild >= size ) {
      return leftChild;
    }

    // parent has two children, return the smaller of them
    if ( comparator.compare( heap[leftChild],
                             heap[rightChild] ) < 0 ) {
      return leftChild;
    }
    return rightChild;
  }