DSA assignment 1
DSA assignment 1
2 MARKS QUESTIONS
SLNO QUESTION CO/PO
1 What is data structure? Define Abstract data type. CO1/PO1
2 Define stack and queue with examples. CO1/PO1
3 Given one dimensional array A[100] in which each memory location of size 16 bytes. Find the address of A[20] CO1/PO2
when the base address is 10000.
4 Define row major order and column major order. CO1/PO1
5 Suppose an array A[10] having contains elements from index 0 to 5. How can we insert a new item at index 2 CO1/PO2
without disturbing the linear order of elements in array?
6 Define sparse matrix with a suitable example. CO1/PO1
7 The following sequence of operations are performed on an empty stack: CO2/PO2
PUSH (1), PUSH (0), PUSH (0), PUSH (1) , POP, POP, PUSH(1), PUSH(0), POP
Write the sequence of the popped out items.
8 Find out the PREFIX expression for the given infix : (B *C ^ D) using mathematical process of conversion. CO1/PO2
9 Convert the following infix expression (C * D ^ E ) into postfix using STACK CO2/PO2
10 List out different common operations we apply on a 1D array. CO1/PO1
5 MARK QUESTIONS
SLNO QUESTION CO/PO
1 List out the standard notations of algorithm. CO1/PO1
2 Given a matrix Q[7][8] in which the size of each memory location is 4 bytes. Find the address of Q[5][2] when the CO3/PO2
base address is 5000 and the memory is occupied in row major order.
3 Write an algorithm to perform insertion of an element give ITEM=99 into a location given LOC=5 into an integer CO3/PO3
array W[100] having elements from lower bound LB=0 and upper bound UB=10.
4 Using stack demonstrate how to generate equivalent postfix expression of the infix expression CO3/PO3
(A+B-(C*D/E))
5 Briefly elaborate the evaluation process of given postfix expression P = 2, 3, 15, 10, 2, /, -, *, +, 4, + using stack CO3/PO3
6 Write down the algorithm to test a matrix is sparse or not and if sparse store the non-zero information into another CO2/PO2
3-column matrix.
7 Write a program using C to create a stack of numbers and perform using UDF: CO2/PO2
(i) push operation (ii) pop operation (iii) display operation
8 Write a C program to create methods for operations insertion and display on 1D array of elements using UDF. CO3/PO2
9 Find the postfix expression of given infix: (Q-W*E/(R+T*Y)-U) using stack. Also write down the algorithm for CO3/PO3
infix to postfix conversion using stack.
10 Briefly elaborate the operations of stack using a suitable example by emphasizing on overflow and underflow CO1/PO2
situations encounter.