**fig3_19.txt** /* 1*/ // Class declaration for a sorted linked list. /* 2*/ template /* 3*/ class Sorted_List : public List /* 4*/ { /* 5*/ public: /* 6*/ virtual void Insert( const Etype & X ); /* 7*/ virtual void Insert_As_First_Element( const Etype & X ) /* 8*/ { Error( "Illegal operation for sorted list." ); } /* 9*/ }; /* 1*/ // Sorted insertion. /* 2*/ template /* 3*/ void /* 4*/ Sorted_List:: /* 5*/ Insert( const Etype & X ) /* 6*/ { /* 7*/ for( Node *P = List_Head; P->Next != NULL; P = P->Next ) /* 8*/ if( P->Next->Element > X ) /* 9*/ break; /*10*/ Current_Pos = P; /*11*/ List::Insert( X ); /*12*/ }