hmmer-3.3/easel/esl_red_black.c
/* Computes the maximum depth (depth of the deepest leaf) of a red-black tree */
Computes the maximum depth (depth of the deepest leaf) of a red-black tree
Computes the maximum depth ( depth of the deepest leaf ) of a red - black tree
uint32_t esl_red_black_doublekey_max_depth(ESL_RED_BLACK_DOUBLEKEY *tree){
  uint32_t large_max, small_max;
  if(tree == NULL){
    return 0;
  }
  large_max = esl_red_black_doublekey_max_depth(tree->large);
  small_max = esl_red_black_doublekey_max_depth(tree->small);
  if(large_max > small_max){
    return (large_max + 1);
  }
  else{
    return (small_max + 1);
  }
}
uint32_t esl_red_black_doublekey_max_depth ( ESL_RED_BLACK_DOUBLEKEY * tree ) { uint32_t large_max , small_max ; if ( tree == NULL ) { return 0 ; } large_max = esl_red_black_doublekey_max_depth ( tree -> large ) ; small_max = esl_red_black_doublekey_max_depth ( tree -> small ) ; if ( large_max > small_max ) { return ( large_max + 1 ) ; } else { return ( small_max + 1 ) ; } }
Computes the maximum depth (depth of the deepest leaf) of a red-black tree
Computes the maximum depth ( depth of the deepest leaf ) of a red - black tree