Page 182 - C++
P. 182

else

               {

                       cout<<”\nThe value of U of the element to delete: ““<<Front → U;

                       cout<<”\nThe value of V of the element to delete:“<<Front → V;

                       temp=Front;

                       Front=Front → Link;

                       delete temp;

               }

        }

                                                             OR

        (d) Write a function in C++ to perform a PUSH operation on a dynamically allocated stack containing real
            numbers.                                                                                          (4)


        struct Node
        {


         float Number ;
        Node *Link ;

        } ;

        class STACK

        {

               Node *Top ;

        public :

               STACK( ) {Top = NULL ;}

               void PUSH( ) ;

               void POP( ) ;

               ~STACK( ) ;

        } ;

        Ans.

        struct Node

        {

        float Number ;
   177   178   179   180   181   182   183   184   185   186   187