Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Ravi Kiran

CBSE CLASS XII

Q.2. Evaluate the following postfix notation of expression : 10 20 + 25 15 - * 30 /

Ans:

Children, Try this answer as an assignment.

OUTSIDE DELHI : 2005

Q.1. Write a function in C++ to perform a DELETE operation in a dynamically allocated queue considering the following description .
struct Node
{ float U, V ;
Node *Link ;
} ;
class QUEUE
{
Node *Rear, *Front ;
public :
QUEUE( ) {Rear = NULL ; Front = NULL ;}
void INSERT( ) ;
void DELETE( ) ;
~ QUEUE( ) ;
} ;
Solution: void Queue::DELETE( )
{
NODE *temp;
if(front= = NULL)
cout<<”\nQueue Underflow”;
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;
}
}

Q.2. Evaluate the following postfix notation of expression : 20 10 + 5 2 * - 10 /

Ans:

Children, Try this answer as an assignment.

2004

Q.1. Obtain the postfix notation for the following infix notation of expression showing the contents of
the stack and postfix expression formed after each step of conversion : (P—Q)/(R*(S—T)+U)

Paper By Mr. Ravi Kiran
Email Id : [email protected]