Data Structure - Stack and Queue (SET - 1)
Data Structure - Stack and Queue (SET - 1)
[SET 1]
Question 1
Question 2
Question 3
Convert the expression (True && False) || !(False || True) to postfix expression.
Show the contents of the stack at every step.
Question 4
Use a stack to evaluate the following postfix expression and show the content
of the stack after execution of each operation. Don't write any code. Assume as
if you are using push and pop member functions of the stack.
AB-CD+E*+ (where A=5, B=3, C=5, D =4, and E=2)
Question 5
Evaluate the following postfix expression using a stack and show the contents
of stack after execution of each operation :
50,40,+,18, 14,-, *,+
Question 6
Evaluate the following postfix expression using a stack and show the contents
of stack after execution of each operation :
TRUE, FALSE, TRUE, FALSE, NOT, OR, TRUE, OR, OR, AND
Question 7
Complete the class with all function definitions for a circular queue
class queue
{
int data[10];
int front, rear;
1 www.cppforschool.com
public :
queue(){front=-1;rear=-1}
void add();
void remove();
}
Question 8
Question 9
Question 10
2 www.cppforschool.com