src/stdlib/sequence.c
/*======================================================
 * sinsseq -- Insert item to sorted location in sequence
 *====================================================*/
- Insert item to sorted location in sequence
- Insert item to sorted location in sequence
SEQUENCE
sinsseq (SEQUENCE seq,   
         ELEMENT el)     
{
	INT i;
	ELEMENT *d=0;
	(void) tinsseq(seq, (ELEMENT) 0);
	d = Data(seq);
	i = Size(seq) - 1;
	while (i > 0 && el < d[i-1])  {
		d[i] = d[i-1];
		--i;
	}
	d[i] = el;
	return seq;
}
SEQUENCE sinsseq ( SEQUENCE seq , ELEMENT el ) { INT i ; ELEMENT * d = 0 ; ( void ) tinsseq ( seq , ( ELEMENT ) 0 ) ; d = Data ( seq ) ; i = Size ( seq ) - 1 ; while ( i > 0 && el < d [ i - 1 ] ) { d [ i ] = d [ i - 1 ] ; -- i ; } d [ i ] = el ; return seq ; }
sinsseq -- Insert item to sorted location in sequence
sinsseq -- Insert item to sorted location in sequence
/* sequence */ /* element */