Quad tree search
search( key, t ) typekey key[K]; tree t; { int i, indx, noteq; while( t != NULL ) { indx = noteq = 0; for (i=0; i
t->k[i] ) indx++; if ( key[i] != t->k[i] ) noteq++; } if ( noteq ) t = t->p[indx]; else { found( t ); return; } } notfound( key ); };
C
source (351.srch.c)
©
Addison-Wesley
Publishing Co. Inc.