Sie sind auf Seite 1von 3

1

KENDRIYA VIDYALAYA NER BAREILLY


AUTUMN BREAK HOMEWORK
SUBJECT: COMPUTER SCIENCE (083)
CLASS: XII

Q1: Write a complete program in C++ to implement a dynamically allocated Stack containing
names of Countries.
Q2: Write a complete program in C++ to implement dynamically allocated Queue containing
names of Cities.
Q3: Each node of a STACK contains the following information, in addition to required
pointer field :
i) Roll number of the student ii) Age of the student
Give the structure of node for the linked stack in question.
Top is a pointer pointing to the topmost node of the STACK. Write the following
functions:
i) PUSH( ) To push a node in to the stack which is allocated dynamically.
ii) POP( ) To remove a node from the stack and release the memory.
Q4: Convert the expression (TRUE && FALSE) || ! (FALSE ||TRUE) to postfix expression.
Show the contents of the stack at every step.
Q5: Write a function PUSHBOOK( ) in C++ to perform insert operation on a dynamic stack,
which contains Book_No and Book_Title. Consider the following of NODE, while writing
your C++ code:
struct NODE
{
int Book_No;
char Book_Title[20];
NODE *Next;
};
Q6: Write a function in C++ to perform insert operation in a dynamic queue containing
DVDs information (represented with the help of an array of structure DVD).
struct DVD
{
long No; //DVD Number
char Title[20]; //DVD Title
DVD *Link;
};
Q7: Write a function in C++ to perform Delete operation on a dynamically allocated queue
containing members details as given in the following definition of NODE.
struct NODE
{
long Mno; //Member Number
char Mname[20]; //Member Name
NODE *Link;
};
Q8: Translate following infix expression into its equivalent postfix expression:
(A + B D) / (E F) + G
Q9: Gave postfix form of expression for the followings:
i) NOT A OR NOT B AND NOT C
ii) NOT ( A OR B) AND C
Q10: Evaluate the following postfix notation of expression:
TRUE, FALSE, NOT, AND, TRUE, TRUE, AND, OR
Q11: Evaluate the following postfix expression using a stack and show the contents of stack
after execution of each operation:
120, 45, 20, +, 25, 15, -, +, *
2

Q12: Each node of a STACK contains the following information, in addition to required
pointer field :
i) Pin code of a city ii) Name of the City
Give the structure of node for the linked stack in question.
Top is a pointer pointing to the topmost node of the STACK. Write the following
functions:
i) PUSH( ) To push a node in to the stack which is allocated dynamically.
ii) POP( ) To remove a node from the stack and release the memory.
Q13: Write a function POPBOOK( ) in C++ to perform delete operation on a dynamic stack,
which contains BNo and Title. Consider the following of NODE, while writing your C++
code:
struct NODE
{
int BNo;
char Title[20];
NODE *Link;
};
Q14: Write a function QINSERT( ) in C++ to perform insert operation on a Linked Queue,
which contains Client number and Client name. Consider the following definition of
NODE in the code of QINSERT( ).
struct NODE
{
long int CNo;
char Cname[20];
NODE *Next;
};
Q15: Write a function QDELETE( ) in C++ to perform delete operation on a Linked Queue,
which contains Passenger number and Passenger name. Consider the following
definition of NODE in the code:
struct NODE
{
long int PNo;
char Pname[20];
NODE *Link;
};
Q16: class queue
{
int data[10];
int front, rear;
public:
queue( ) { front = -1; rear = -1; }
void add( ) ; //to add an element into the queue
void remove( ); //to remove an element from the queue
void delete( ); //to delete all elements which are equal to item
};
Complete the class with all function definitions for a circular queue. Use another queue
to transfer data temporarily.
Q17: Introduction
class stack
{
int data[10];
int top;
public:
stack( ) { top = -1; }
3

void Push( ); //to push an element into the stack;


void Pop( ); //to pop an element from the stack
void Delete( ); // to delete all elements which are equal to item
};
Complete the class with all function definitions for a stack. Use another stack to transfer
data temporarily.
Q18: Solve questions based on Arrays Chapter came in 2014, 2015, 2016 CBSE Qestion Paper.
Q19: Learn the following definitions:
i) Relation
ii) Attribute
iii) Tuple
iv) Domain
v) Degree
vi) Cardinality
vii) Primary Key
viii) Candidate Key
ix) Alternate Key
x) Foreign Key
Q20: Revise All the portion covered i.e. from Review of C++ to Database Concepts. On the
basis of revision, series of class tests will be conducted after re-opening the school.

HAPPY AUTUM BREAK HOLIDAYS

VIJENDRA KUMAR VYAS


PGT(COMP.SC.)
KV NER BAREILLY

Das könnte Ihnen auch gefallen