[Home]
[Chapter]
[Contents]
[Previous Algorithm]
[Next Algorithm]


Insertion for lists


function insert( key : typekey; head : list ) : list; var p : list; begin n := n+1; new(p); p^.k := key; p^.next := head; insert := p; end;

C source (312.ins.c) Pascal source (312.ins.p)



© Addison-Wesley Publishing Co. Inc.