MODULE-1
Questions on Stack Data structure
1. Define stack? Explain different operations that can be performed on
stack with suitable C Functions and Examples? [8 Marks]
2. Write an algorithm to evaluate the postfix expression and also trace
the algorithm for the following expression showing the content of stack
i. 6 5 1 – 4 * 2 3 ^ / + [ 8 Marks]
ii. 5 4 6 + * 4 9 3 / + *
iii. 6 2 3 + - 3 8 2 / + * 2 $ 3 +
3. Convert the following infix expression into postfix expression using
stack
i. A+(B* C-(D/E^F)*G)*H [7 Marks]
ii. (( A/(B-C+D))*(E-A)*C)
4. Mention the applications of stacks [ 4 Marks]
MODULE-2
QUEUE and LINKED LIST
Answer the following:
1. Write the difference between Arrays and Queue [ 4 Marks]
2. Write a note on Dequeue and Priority Queue [ 5 Marks]
3. Define Queue? Develop C Functions to implement Insert(), Delete() and
Display() on Ordinary Queue? [8 Marks]
4. Define Queue? Develop C Functions to implement Insert(), Delete() and
Display() on Circular Queue? [8 Marks]
5. A Circular queue the size of which is 5 has 3 elements 10,40,25, where
F = 2 and R = 4. After inserting 50,60, what is the value of F and R?
Trying to insert an element 30 at this stage what will happen? Delete 2
elements from the queue and insert 100. Show the sequence of steps
with necessary diagrams with the value of F and R
6. Show the content of circular Queue after performing each of the
following operations (Circular Queue of size 5)
a. Empty Queue
b. Insert 10
c. Insert 20 and 30
d. Insert 40 and 50
e. Insert 60
f. Delete two items
g. Insert 60 and 70
h. Insert 80 [ 8 Marks]
7. Define Queue? What are the different types of Queue? State the
limitations of an ordinary Queue. Explain how do you overcome the
limitation by specifying the required C-statements and diagrammatic
representation using example[10 Marks]
8. What is linked list? Explain different types of linked list with diagrams
and examples[8 Marks]
9. Write C Functions for the following operations on Singly linked list
i. Inserting node at the beginning
ii. Inserting node at the rear end of linked list
iii. Delete node at the beginning
iv. Delete node at the rear end of linked list
v. Display the content of the linked list [ 10 Marks]
10. What is self referential structure? Explain with Example the self-
referential structure? [5 Marks]
11. Explain C-statements to create a node, add a node, delete a node on a
Singly Linked List with proper message where each node is containing
the details of employees in the form of EmpId,EmpName,Empaddr and
EmpSalary as Data fields[ 10Marks]
12. Write C Functions for the following operations on Circular Singly linked
list
i. Inserting node at the beginning
ii. Inserting node at the rear end of linked list
iii. Delete node at the beginning
iv. Delete node at the rear end of linked list
v. Display the content of the linked list [ 10 Marks]
13. Write a node structure for linked list representation of polynomial and
C-function to add the polynomial term at the rear_end of the linked
list[8 Marks]
MODULE-3
LINKED LIST and TREES