Csa 2001
Csa 2001
Csa 2001
PRESIDENCY UNIVERSITY
BENGALURU
Instructions:
(i) Read all questions carefully and answer accordingly.
(ii) Do not write anything on the question paper other than the roll number.
R
Ma C
Questions B
rks O
Q.No T
C
a. What is data structure? Explain various types of data structures in detail. 4 O L1
1
C
b. What is bubble sort? Explain the advantages and disadvantages of bubble sort. 6 O L2
1
1
c. What is selection sort. Explain algorithm of selection sort with an example C
array. 10 O L3
1
OR
C
a. List out the areas in which data structures are applied extensively. 4 O L1
1
C
b. Write a c program to extract a substring from the given string. 6 O L2
2
1
c. What do you mean by the complexity of an algorithm? Explain the meaning of C
worst-case analysis and best-case analysis with an example. 10 O L3
1
C
a. Write and explain POP operation algorithm of a stack. L
3 4 O
1
2
Page 1 of 3
b. Consider size of stack as 5.Apply following operation on stack and show the status of
stack and top pointer after each operation . i ) push a , b, c ii) pop iii) push e,f iv) pop C
L
6 O
2
v) push g h vi)push m vii)pop 2
C
c. Convert the following infix expression to postfix using stack (A+B*C)/(D-E)+F 1 L
O
0 3
2
OR
c. What are queues? Write down an algorithm for inserting and deleting elements from C
1 O2 L
a queue implemented using arrays. 0 3
OR
C
a. Define: binary tree, complete binary tree, strict binary tree. L
4 O
1
4
b. Construct binary search tree for following data: 6, 8, 33, 3, 40, 2, 9, 10, 22, 15, and C
L
17. Consider 10 as root. 6 O
7 2
4
c. Show the result of inserting 3,1,4,6,9,2,5,7 into an initially empty binary search tree. C
1 L
Also write down the result of 3 traversals on this binary search tree. O
0 3
4
OR
a. What is Binary search tree? Write the application areas that use a binary search tree.
4 CO4 L1
8
b. Write an algorithm for the following
6 CO4 L2
1) In order tree traversal
Page 2 of 3
2) Pre order tree traversal
3) Post order tree traversal
C. Given the following inorder and preorder traversal reconstruct a binary tree
Preorder – A,B,D,E,H,C,F,I
C
a. Write a C program to find the factorial of a given number. L
4 O
1
1
C
b. Explain the classification of data structure and operations on data structures. L
6 O
9 2
1
c. Why do we use asympatotic notation in the study of algorithm? Describe commonly C
1 L
used asymptotic notation and give their significance. O
0 3
1
OR
Page 3 of 3