代码语言:javascript复制
markEE( Point S[], int n ) //n > 2
for ( int k = 0; k < n; k )
S[k].extreme = FALSE;
for ( int p = 0; p < n; p ) //test
for ( int q = p 1; q < n; q ) //each
checkEdge( S, n, p, q ); //directed edge pq
代码语言:javascript复制checkEdge( Point S[], int n, int p, int q )
bool LEmpty = TRUE, REmpty = TRUE;
for ( int k = 0; k < n && ( LEmpty || REmpty ); k )
if ( (k != p) && (k != q) )
ToLeft( S[p], S[q], S[k] ) ?
LEmpty = FALSE :
REmpty = FALSE ;
if ( LEmpty || REmpty )
S[p].extreme = S[q].extreme = TRUE;