2

i make push procedure but its not working, there something wrong with my code??
please see my following push procedure :

procedure PUSH (var T: Stack; var Full: boolean;
                     X: integer);
 begin
   if T.Top = MaxElemen then
       Full := true
   else
      begin
        
        T.Top := inc(T.Top);
        T.Contain[T.Top] := X
      end
 end;
Votes + Comments
thx
2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Jx_Man
3

i think you forget to set full = false, just it.
add this code after else :

begin
        Full := false;
        T.Top := inc(T.Top);
        T.Contain[T.Top] := X
      end

ok hope this helps..

Votes + Comments
upss..i forgot. thanks for the great helps..want to see your help again
:D
1

you're welcome. its ok, everybody can make mistake. happy coding friend :)
all for the best.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.