DSA pyq
DSA pyq
Semester
Tuesday
30/04/2019
Subject Name Time Code
Data structure & File Marks
(Repeater) Processing (CSTIIT)
10.30 AM
To
01.00 PM
3163 75
Instruction:
)Question 1. is
Solve any FOUR coipulsory.
rom Q 2. to 07.
Assume the
1V) Figure on suitable data whe ver hecessary.
right indicates tlhe marks
O1 given to the question.
Answer the following(Any three)
a) Define
structure in C. Explain structure along with 15.
Q3. a) What are different advantages of linked list as compared with sequential starage? Also
Write an algorithm insert an element at the end of a linked list.
Q4. What is parition-exch esort? Write an algorithm for the same. Parition the following
einn the
list of 10 numbers using 1 alorithn and not otherwise considering the first elernent 42
as a pivote.
(42, 23, 74, 11, 65, 58, 94, 36, 99, 87) 15
Q5 a) Define BST Construct the BST for the following list of numbers. Also write an iterative
algorithm to searcha elenent in BST.
[38, 14, 56, 8, 23, 45, 82, 18, 70] B
b) Generate the Huffman tree for the source symbols (a, b, , d e,f, g. h) with frequencies
(22, 5, 11, 19, 2, 11, 26, 5) respectively and in turn find the Huffman codes for all the
source symbols.
Page 1 of 2
example
b Write an algorithm to delete a node from doubly linked list.
Comment on o
complexity of algorithm.
Q.5 a) Sort following clements using Quick sort. Consider first
clement. clement as pivot o
70 20 35 46 10 25
b Write and explain heapify procedure with proper example.
Q.1is Compulsory.
Solve any four questions from remaining questions.
1S
Q.1 Answer the following. (Any five)
a) Define time and space complexity.
b) What are the commonly used asymptotic notations.
c) Compare linear and non-linear data structures.
d) What are the different operations performed on data structures. on input array
e) What will be the output list after completing first pass of bubble sort
32,51,27,85,66,23, 13,57
of node and height of tree.
) Explain tree terminologies node, height of node, depth
B) Define Hash table.
08
using array.
Q.2 a)Write PUSH and POP algorithms of stack operation
b)What is doubly linked list? Explain insert in doubly linked list.
08
Q.3 a) Compare stack and Queue using array. and overflow operations using array 07
b) Explain enqueue,dequeue, underflow
for circular queue.
CE
Instruction:
Question I is compulsory. Solve any 4 from remaining questions.
Assume any data if required and also mention it.
Q.2 a) How to delcte un element from circulur queue? Write the algorithm and (7)
explain with an example.
by Illustrate algorithm of binary search. Search the clement -6 from the list (8)
given below using binary seurch. Write limitation of binary search.
-15. -6.0,7.9, 23. S4. 82, 101
Q.3 a) Write an algorithm to insert an element at the end of singly linked list. (7)
b) Write algorithms to push and pop an clement from stack. Commet on (8)
complexity of algorithms.
Q.4 a) What is AVL tree? Explain rotations performcd to balance AVL tree with (7)
BACHELOR OF TECHNOLOGY
Day &Date Subject Name Time |Code Max. Marks
Semester
Q.5. a)What is Btree ? How can you perform insertion and deletion in Btre. 08
Explain with proper example.
b) Write bubble sort algorithm with proper example. 07
0.7 a) Explain adjacency list and adjacency matrix representation w.r.t graph. 08
b) Explain BFS algorithm in detail 07
BACHELOR OF TECHNOLOGY
and Algorithmsg6Pm
Q.1 is Compulsory.
Solve any four questions from remaining questions.
15
Q1 Answer the following. (Any five)
a) Define time and space complexity
b) What are the commonly used asymptotic notations.
c) Compare linear and non-linear data structures.
d) What are the different operations performed on data structures.
e) What will be the output list after completing first pass of bubble sort on input array
32,51,27,85,66,23, 13,57,
) Explain tree terminologies node, height of node, depth of node and height of tree.
g) Define Hash table.
O8
Q3 a) Compare stack and Queue using array.
b) Explain enqueue ,dequeue, underflow and overtlow operations using array 07
0.7a) xplain adjacency list and adjacency matrix representation w.r.t graph. 07
b) Explain BFS alyorithm in detail.
example.
b) Write an algorithm to delete a node from doubly linked list. Comment on
complexity of algorithm.
a) Sort following elements using Quick sort. Consider first clement as pivot m
element.
70 20 35 46 10 25
b) Write and explain heapify procedure with proper example.
Q.7 a) What is
circular linked list? Write steps to
circular singly list.
linked circular linked list. Write insert a node a!
steps to insert at the
b) Write the leftmost position inhead of
doubly
BFS algorithm and calculate BFS and
DFS of given
graph.
example. on
node from doubly linked list. Comment
a
b) Write an algorithm to delete
complexity of algorithm.
CE
Instruction:
Question I is compulsory. Solve any 4 from remaining questions.
Assume any data if required and also mention it.
(31
Q. 1 a) Calculate prefix and sutffix of the expression A"B C/D
b) Define asymptotic upper bound. Draw dhagram illustrating it. (3)
Q.2 u) How to delete un element from circular qucue? Write the algorithm and (71
explain with an example.
b) Illustrate algorithm of binury search. Scarch the element -6 from the list (8)
given below using binary scurch. Write limitation of binary scarch.
-15, -6, 0,7,9.23, 54. 82, 101
Q.3 a) Write an algorithm to insert an element at the end of singly linked list. (7
b) Write algorithms to push and pop an clement from stack. Comment on (8)
complexity of algorithms.
Q4 a) What is AVL tree? Explain rotations performed to balance AVL tree with ()
BACHELOR OF TECHNOLOGY (New/Old Course)
Day & Date Semester Subjeet Name Time Code Max.
Marks
2l2022
Data Structure & Algorithms 343411 75
CE
Instruction:
Question Iis compulsory. Solve any 4 from remaining questions.
Assume any data if reguired and also mention it.
Q.2 How to delete un element from circulur qucue? Wite the algorithm and (7)
explain with un cxaunple.
b) Illustrate algorithm of binary search. Seareh the element -6 from the list (8)
given below using binary scarch. Write limitation of binary search.
-15. -6.0, 7.9,23. 54. 82. 101
Q.3 a) Write an algorithm to insert an element at the end of singly linked list. (7)
b) Write algorithms to push and pop an clement from stack. Comment on (8)
complexity of algorithms.
Q4 u) What is AVL tree? Explain rotations performed to balance AVL tree with (7)
Bachelor of Technology Examination: Nov/Dec 2022
Day & Date Semester Subject Name Time Code
Max.Mark
03/05/2023 75
Data Structure & Algorithms 02.30 to 5.00 PM 343411
(CST/IT/Ds/CE)
Instructions:
) Ouestion no. Iis eompulsory.
I1) Solve any FOUR questions from Q2. To Q7.
l ) Assume the suitable data wherever necessary
IV) Figure on riglt indicates the marks given to the question.
a) Define Time and Space complexity. Also find the asymptotic time complexity of the
following algorithm using frequency count method.
Algorithm Test(a, n)
a:1:
while(a <n)
statement 1:
a2;
Q2. a) Write an algorithm for inserting an element and deleting an element from acircular queue 10.
b) Write a detailed note on linked representation of stack. 5
Q3. a) list.
Define linked list. Also write an algorithm to delete an element from singly linked
10
Q4. a) Write an algorithm for Quick Sort and explain the PARTITION procedure on the
following set of elements: 10
65 70 75 80 85 60 5S 50 70
Instr
Q.N
Q6. a) Write an algorithm to search the graph in Depth First search (DFS) manner along 10
with its time complexity. Also find the DFS sequence for the following graph.
07. a))What is collision in Hashing? Use Quadratic probing method of collision resolution
to store following keys/elements in the hash table using division method.
23 43 13 27 15 10
b) Write an iterative algorithm for Binary search.
08
Q.6 a) Explain DFS for the following graph with all the steps. Consider 'a' as
the starting node
In
1.32
Bachelor of Technology (B. Tech) Examination: February - 2023
Day &Date Semester Subject Name Time Code Marks
Data Structure & 02:00 PM
Monday Algorithms To 343411 75
20-02-2023 (Fresh) (CST/ITIDS/CE) 04:30 PM
08
Q.3 a) Compare stacks and Queues.
Write and explain the algorithm to delete a node from the list 07
b)
a) Solve the following infix expression by evaluating its prefix and postfix
08
Q.4
notation ((AX + (B*CY))(D-E))
its in-order. 07
b) What is Binary Search Tree (BST)? For the given tree write
preorder and post-order traversal with all the steps.
root
15 50
35
22
31 44
12 18 24
08
Q.5 a) Illustrate with an example Priority queue. 07
b) Write merge sort algorithm with proper example
Page 1 of 2
Bachelor of Technology (B. Tech) Examination: February- 2023
CodeMarks
Day &Date Semester Subject Name Time
Data Structure & 02:00 PM
Monday To 343411 75
20-02-2023 (Fresh) Algorithms
(CSTITIDS/CE) 04:30 PM
15
Q.1 Answer the following. (Any Five)
a) Compare linear and non-linear data structures
b) Explain the qualities of a good algorithm.
c) What are the commonly used asymptotic notations.
d) Explain AVL trees.
e) What will be the output list after completing first pass of bubble sort on
input array 32,51,27,85,66,23,13,57
) Explain tree terminologies node, height of node and leaf node.
g) Define Hashing
Q.2 a) Wite PUSH and POP algorithms of stack using array. 08
b) What are the applications of data structures? Compare Array vs Linklist. 07
Q.4 a) Solve the following infix expression by evaluating its prefix and postfix 08
notation (AX + (B*CY)V(D-E)
b) What is Binary Search Tree (BST)? For the given tree write its in-order, 07
preorder and post-order traversal with all the steps.
root
25
15
50
UMI
Satatur
18
61.39
Page 1 of 2
Q.6 a) Explain DFS for the following graph with all the steps. Consider 'a' as 08
the starting node
Q.7 a) Explain adjacency list and adjacency matrix representation w.r.t graph 08
b) Explain BFS algorithm in detail and illustrate using an example. 07
d6010