Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function countStack(z:TZasobnik):integer;
- var p : TuPrvek;
- i:integer;
- begin
- p:= z.vrchol;
- i := 0;
- while p <> NIL do begin
- p := p^.dalsi;
- i := i + 1;
- end;
- countStack := i;
- end;
- procedure destroyStack(z:TZasobnik);
- var hloubka,i:integer;
- smaz:TuPrvek;
- begin
- hloubka := countStack(z);
- for i:=1 to hloubka do begin
- smaz := z.vrchol;
- z.vrchol := smaz^.dalsi;
- dispose(smaz);
- end;
- stackInit(z);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement