[Home]
[Contents]
[Chapter]
[Previous Algorithm]
[Next Algorithm]


B-tree search (Pascal version available)


search( key, t ) typekey key; btree t; { int i; while (t != NULL) { for (i=0; i<t->d && key>t->k[i]; i++); if (key == t->k[i]) { found( t, i ); return; } t = t->p[i]; } notfound( key ); };

C source (342.srch.c) Pascal source (342.srch.p)



© Addison-Wesley Publishing Co. Inc.