Advertisement
ridjis

IspisiPuteve

Dec 24th, 2014
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PROCEDURE IspisiPuteve (s:stablo;niz:ARRAY OF INTEGER;n:INTEGER);
  2. VAR i:INTEGER;
  3. BEGIN
  4.     IF s#NIL THEN
  5.        
  6.         IF (s^.levo=NIL) AND (s^.desno=NIL) THEN
  7.             niz[n] := s^.id;
  8.             FOR i:= 0 TO n DO
  9.                 WriteInt(niz[i],0);
  10.             END;
  11.             WriteLn;
  12.         ELSE
  13.             niz[n] := s^.id;
  14.             IspisiPuteve(s^.levo, niz, n+1);
  15.             IspisiPuteve(s^.desno,niz, n+1);
  16.         END;
  17.     END;
  18. END IspisiPuteve;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement