hmmer-3.3/easel/esl_red_black.c
/* Computes the minimum depth (depth of the shallowest leaf) of a red-black tree */
Computes the minimum depth (depth of the shallowest leaf) of a red-black tree
Computes the minimum depth ( depth of the shallowest leaf ) of a red - black tree
uint32_t esl_red_black_doublekey_min_depth(ESL_RED_BLACK_DOUBLEKEY *tree){
  uint32_t large_min, small_min;
  if(tree == NULL){
    return 0;
  }
  large_min = esl_red_black_doublekey_min_depth(tree->large);
  small_min = esl_red_black_doublekey_min_depth(tree->small);
  if(large_min > small_min){
    return (small_min + 1);
  }
  else{
    return (large_min + 1);
  }
}
uint32_t esl_red_black_doublekey_min_depth ( ESL_RED_BLACK_DOUBLEKEY * tree ) { uint32_t large_min , small_min ; if ( tree == NULL ) { return 0 ; } large_min = esl_red_black_doublekey_min_depth ( tree -> large ) ; small_min = esl_red_black_doublekey_min_depth ( tree -> small ) ; if ( large_min > small_min ) { return ( small_min + 1 ) ; } else { return ( large_min + 1 ) ; } }
Computes the minimum depth (depth of the shallowest leaf) of a red-black tree
Computes the minimum depth ( depth of the shallowest leaf ) of a red - black tree