All pastes #31581 Raw Edit

Unnamed

public text v1 · immutable
#31581 ·published 2005-11-28 20:09 UTC
rendered paste body
template <class Item>
void Sequence_2<Item>::Split (
			preserves Integer position,
			produces Sequence_2& receiving_s
		)
   // alters self
   // pre:  0 <= position <= |self|
   // post: there exists r, t: string of Item,
   //       #self = r  +  t  and  |r| = position  and
   //       self =  r  and  receiving_s = t
{
	variable Node p;
	variable Integer i;
	
	p = head;
	for (i = 0; i < position; i++) {
		p = p->next;
	} // end for
	receiving_s.Clear ();

}	// Split