//Filename: list.c //Developer: Jay Suttiruttana #include "btree.h" //function prototypes void Show( Record_type record ); int Traverse(int rrn); void main(void) { dta_open(); //open database file btopen(); //open b-tree file Traverse( getroot() ); /* start from the root of the B-Tree */ dta_close(); //close the database file btclose(); //close the b-tree file } /******************************************************************************* Function: Traverse () Task: the user passes the the root of any B-Tree, and this function will traverses the tree and displays the records in the key order. Pre: the rrn passed in is valid. Post: the information of records is displayed in the order of the key. *******************************************************************************/ int Traverse(int rrn) { page_type page; int i; if( rrn == NIL ) return( 0 ); /* Retrieve current page */ btread(rrn, &page); for(i=0; i