האם הפרוצדורה הבאה
מקיימת את טענת הכניסה והיציאה? edure max(l:list_type); (הפרוצדורה מקבלת רשימת מספרים L) (ומחזירה את רשימת המספרים העוקבים המקסימלית)max,m:integer; l1:list_type; x,y:list_info_type; endl,p,q:pos_type; begin max:=0; m:=0; list_init(l1); p:=list_next(l,list_anchor(l)); q:=list_next(l1,list_anchor(l1)); list_retreive(l,p,x); x:=predd(x); while p<>list_end(l) do begin if x=list_next(l,p) than begin m:=m+1; if m>max than begin max:=m; endl:=p; end; end; end; p:=endl-max; for i:= 1 to m do begin list_retreive(l,p,x); list_insert(l1,q,x); end; while (q<>list_end(l1)) do begin list_retreive(l1,q,y); write(y); end; end;{proc max}
|