3 int cs_leaf (
int i,
int j,
const int *first,
int *maxfirst,
int *prevleaf,
4 int *ancestor,
int *jleaf)
6 int q, s, sparent, jprev ;
7 if (!first || !maxfirst || !prevleaf || !ancestor || !jleaf)
return (-1) ;
9 if (i <= j || first [j] <= maxfirst [i])
return (-1) ;
10 maxfirst [i] = first [j] ;
11 jprev = prevleaf [i] ;
13 *jleaf = (jprev == -1) ? 1: 2 ;
14 if (*jleaf == 1)
return (i) ;
15 for (q = jprev ; q != ancestor [q] ; q = ancestor [q]) ;
16 for (s = jprev ; s != q ; s = sparent)
18 sparent = ancestor [s] ;
int cs_leaf(int i, int j, const int *first, int *maxfirst, int *prevleaf, int *ancestor, int *jleaf)