Docsity
Docsity

Przygotuj się do egzaminów
Przygotuj się do egzaminów

Studiuj dzięki licznym zasobom udostępnionym na Docsity


Otrzymaj punkty, aby pobrać
Otrzymaj punkty, aby pobrać

Zdobywaj punkty, pomagając innym studentom lub wykup je w ramach planu Premium


Informacje i wskazówki
Informacje i wskazówki

Źródła z cw - Notatki - Programowanie, Notatki z Informatyka

Informatyka: notatki z zakresu programowania dotyczące źródeł z cw.

Typologia: Notatki

2012/2013

Załadowany 12.04.2013

Norbert_88
Norbert_88 🇵🇱

4.5

(30)

322 dokumenty

Podgląd częściowego tekstu

Pobierz Źródła z cw - Notatki - Programowanie i więcej Notatki w PDF z Informatyka tylko na Docsity! procedure Init; begin top:=nil; NumItems:=0; END; procedure Push (x:integer); var temp : PCell; begin if not Full then begin new(temp); temp^.element:=x; temp^.next:=top; top:=temp; inc (NumItems); end; end; procedure Pop; var temp : PCell; begin if not Empty then begin temp:=top; top:=temp^.next; dispose (temp); dec (NumItems); end; end; procedure MakeNull; begin while not Empty do Pop; end; function First : integer; begin if not Empty then First:=top^.element; end; procedure StackShow; var temp: PCell; begin Form1.Memo1.Lines.Clear; if not Empty then begin temp:=top; while temp <> nil do begin Form1.Memo1.Lines.Add (IntToStr(temp^.element)); temp:=temp^.next;end;end;end; procedure StackDraw; var maxx, maxy, y : integer; temp : PCell; begin maxx:=Form1.PaintBox1.Width; maxy:=Form1.PaintBox1.Height; Form1.PaintBox1.Canvas.Brush.Color:=Form1.Color; Form1.PaintBox1.Canvas.FillRect(Rect (0,0,maxx,maxy)); if not Empty then begin temp:=top; y:=maxy-NumItems*18-3; while temp <> nil do begin Form1.PaintBox1.Canvas.Rectangle(6,y,maxx-6,y+15); Form1.PaintBox1.Canvas.TextOut(20,y+1,IntToStr (temp^.element)); y:=y+18; temp:=temp^.next;end;end;end;
Docsity logo


Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved