**fig4_23.txt** /* 1*/ template /* 2*/ void /* 3*/ Binary_Search_Tree:: /* 4*/ Insert( const Etype & X, Tree_Node * & T ) /* 5*/ { /* 6*/ if( T == NULL ) /* 7*/ { /* 8*/ T = new Tree_Node( X ); /* 9*/ if( T == NULL ) /*10*/ Error( "Out of space" ); /*11*/ } /*12*/ else /*13*/ if( X < T->Element ) /*14*/ Insert( X, T->Left ); /*15*/ else /*16*/ if( X > T->Element ) /*17*/ Insert( X, T->Right ); /*18*/ // Else X is in the tree already. We'll do nothing. /*19*/ }