**fig7_9.txt** /* 1*/ template /* 2*/ void /* 3*/ Merge_Sort( Etype A[ ], const unsigned int N ) /* 4*/ { /* 5*/ Etype *Tmp_Array = new Etype[ N + 1 ]; /* 6*/ unsigned int New_N = N; // Non-constant, for m_sort. /* 7*/ if( Tmp_Array != NULL ) /* 8*/ { /* 9*/ M_Sort( A, Tmp_Array, ( unsigned int ) 1, New_N ); /*10*/ delete [ ] Tmp_Array; /*11*/ } /*12*/ else /*13*/ Error( "No space for tmp array" ); /*14*/ } /* 1*/ template /* 2*/ void /* 3*/ M_Sort( Etype A[ ], Etype Tmp_Array[ ], /* 4*/ unsigned int Left, unsigned int Right ) /* 5*/ { /* 6*/ if( Left < Right ) /* 7*/ { /* 8*/ unsigned int Center = ( Left + Right ) / 2; /* 9*/ M_Sort( A, Tmp_Array, Left, Center ); /*10*/ M_Sort( A, Tmp_Array, Center + 1, Right ); /*11*/ Merge( A, Tmp_Array, Left, Center + 1, Right ); /*12*/ } /*13*/ }