#include "intlist.h"
/* acyclic(x) and l[x]==_l and data(x) */
intlist add2new(intlist x) {
intlist xi = x;
intlist yi, y, z;
yi = y = z = NULL;
while (xi != NULL) {
z = new();
z->data = xi->data + 2;
if (yi == NULL)
y = z;
else {
yi->next = z;
yi = NULL;
}
yi = z;
z = NULL;
xi = xi->next;
}
return y;
}
|
var _data:real, _free:real, _len:real,
_new:real, _next:real, _null:real,
x:real, xi:real, y:real, yi:real, z:real,
_l:int , _k: int, S:int;
begin
assume (x == 0);
y = _null;
yi = _null;
z = _null;
xi = _null;
xi = x;
while xi != _null do
z = _new;
z = (xi * _data + 2) / _data;
z = _null / _next;
if (yi == _null) then
y = z;
else
yi = _null/_next;
yi = z/_next;
endif;
yi = _null;
yi = z;
z = _null;
z = xi * _next;
xi = _null;
xi = z;
z = _null;
done;
end
|