Page 183 - C++
P. 183

Node *Link ;

        } ;

        class STACK

        {

               Node *Top ;

        public :

               STACK( ) {Top = NULL ;}

               void PUSH( ) ;

               void POP( ) ;

               ~STACK( ) ;

        } ;

        void STACK::PUSH( )
        {


               Node *Temp;
               Temp=new Node;


               if(Temp= =NULL)
               {

                       cout<<”\nNo memory to create the node…”;

                       exit(1);

               }

        cout<<”\nEnter the Number to be inserted: “;

        cin>>Temp→ Number;

        Temp→ Link=Top;

        Top=Temp;

        }

         (e) Convert the following Infix expression to its equivalent Postfix expression, showing the stack contents for
        each step of conversion.                                                                             (2)

        (A+B)*(C-D)/E

        Ans.
   178   179   180   181   182   183   184   185   186   187   188