Pictorial representation of the insert algorithm:
All other cases can be handle by the insertion algorithm described above.
if ( .... special case 1 detected ... ) { code to handle insert for special case 1 } else if ( .... special case 2 detected ... ) { code to handle insert for special case 2 } else { code to handle insert for all other cases } |