Binary search tree, extraction of maximum


function extract( var pq : tree ) : typekey; begin if pq=nil then Error {*** extraction from empty queue ***} else if pq^.right = nil then begin extract := pq^.k; pq := pq^.left end else extract := extract( pq^.right ) end;

Pascal source (516c.extr.p)



© Addison-Wesley Publishing Co. Inc.