Professional Documents
Culture Documents
Asgn New
Asgn New
DATA STRUCTURE
QUESTION 1 :
Write a function in C++ to insert in a static circular Queue containing Players information
(represented with the help of array of structure PLAYER).
stuct PLAYER{
int PID;
char Pname[20];
NODE *Next ;
};
(Note: made array based queue output should be clear as array based.
QUESTION 2 :
((A+B)*C-(D-E)) $(F+G)
A+B*(C+D)/F+D*E
Q+F-W*S/D-R/T*P
Show the status of stack after execution of each operation as shown in the example below.
QUESTION 3 :
Evaluate the given Postfix expression. Show your working in the table by providing each
iteration. Assume the value of ABCDEFGH at your own: Also fill the table with example as
well.
ABC*DEF^/G *- H*+
QUESTION 4 :
Write a function to convert infix into postfix using stack and check it by using question 2
expressions.
QUESTION 6 :
Write a code to create shelf contains 20 books .Each book has specific name and a unique
number .Select three book from the middle and removed it from the stack by displaying its name
and unique number with all remaining books contains on the shelf. After that put that removed
books at the top of all books. ( using array based stack)
QUESTION 7 :
Create a queue for ten persons of any name, suppose when a specific person comes to that queue
give them a high priority and shift them directly at the first position of the queue and keep its
previous or position place empty. After that display all the queue before shifting and after
shifting that particular person
Note made queue from linked list and output should be clear and arranged