Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Csa 2001

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Roll No

PRESIDENCY UNIVERSITY
BENGALURU

School Of Computer Science and Engineering & Information Science


Summer term End-Term Examinations, August 2024

Odd Semester: 2023 - 24


Date: 5/08/2024
Course Code: CSA2001
Time: 1:00 pm – 4:00 pm
Course Name: Data Structures and Algorithms
Max Marks: 100
Department: CSE & IS
Weightage: 50%

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

a. Write the algorithm for converting from infix to post-fix. C L


4 O2 1
b. Explain stack data structure and write an algorithm to push and pop an element to C
O2 L
and from the stack. 6
4 2

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

a. Differentiate between List and array in four points. CO L


4
3 1
b. Define linked list. Explain different types of linked list. Mention the advantage of CO L
6
linked list? 3 2
5
c. What is a linked list? Give the data structure and write algorithms to
1 CO L
(i) Delete an element. (ii) Count the number of elements. 0 3 3

OR

a. Write down the steps to modify a node in linked lists. CO L


4
3 1
6 CO L
6
b. Write an algorithm to insert a node at the beginning of the list. 3 2
c. Explain the insertion operation in linked list. How nodes are inserted after a specified 1 CO L
node. 0 3 3

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

Inorder – D,G,B,E,A,F,I,C 10 CO4 L3

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

a. List two sort methods. Give example of each. C L


4
O2 1
b. Explain stack data structure and write algorithm to push and pop an element to C L
1 6
and from the stack. O2 2
0 c. What are queues? Write down algorithm for inserting and deleting elements from
1 C L
a queue implemented using arrays. 0 O2 3

Page 3 of 3

You might also like