0% found this document useful (0 votes)
28 views

DSA pyq

Uploaded by

prakashrutuja7
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

DSA pyq

Uploaded by

prakashrutuja7
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Day &Date

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.

it's syntax and


b) Differentiate
between tree and binary tree. suitable example.
c) What is stack?
Write in detail any one application of
d) Explain wih
stack.
suitable example path matrix or
reachability matrix of graph
Q2. a) Write an
algorithm for inserting an element and deleting an element
from a queue. 8.
b) Define suffix expression. How to
Find if the suffix expression determine wheather a sutfix expression is valid or no?
abtcd-* valid.
is 7

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.

b) Explain in detail circular linked list and all irs variations.


7.

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.6 a) What is hashing? Explain linear probing with example.


b) Wite an iterative algorithm for
preorder
preorder and postorder of following tree. traversal of tree. Find inoder, (

Q.7 What is circular linked


circular singly linked list. list?
Write
Write steps to insert a node at
steps to insert at leftmost positiontheinhead of 0
linked circular list. doubly
b) Write the BFS algorithm and
calculate BFS and DFS of given graph. B
BACHELOR OF TECHNOLOGY
Max. Marks
Day &Date Subject Name Time Code
Scmester
11}-00 4n 343411 75
Thu sdayI Data Structures
and Algorithms

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.

Evaluate the following postfix expression using stack table.


08
Q.4 a) 623 +-382/+*2 A
digit).
(note: Astands for power and all operands are single the following. 07
b) What is Binary Search Tree (BST)? Construct a BST for
19, 74, 33, 28
numbers: 47, 55, 23, 17, 39, 50,9,traversal.
11,
Show all the steps. Write its preorder
and deletion in Btree.
Q.5. a)What is B tree ? How can you perfon insertion
Explain with proper example.
07
b) Write bubble sort algorithm with proper exanple.
sort data structure. 08
Q.6a)a) Explain Quick sort and marge search with example. 07
b) Explain linear search and binary
adjacency matrix representation w.rt graph.
0.7 a) Explain adjacency list and detail. 07
b) Explain BES algorithm in
BACHELOR OF TECHNOLOGY (New/Old Course)
Day & Date Semester
Subjeet Name Time Code Max.
Marks

Data Structure & Algorithms 343411 75

CE
Instruction:
Question I is compulsory. Solve any 4 from remaining questions.
Assume any data if required and also mention it.

Q.1 a) Calculate prefix and suffix of the expression A"B+CD (3)


b) Deline asymptotie upper boumd, Druw diagram illustruting it (3)
c) Generate binary scarch tree of following data. (3)
30 43 I| 73 28 7

Illustrate Depth First Search. (3


What is availability stack? Write steps to get a new node from availability 3)
stack.

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

Thussay Data Structures |//-00 4-) 34341I 75


15]12/14 and Algorithms30 Pm
Q.I is Compulsory.
Solve any four questions from remaining questions.

Q.1 Answer the following. (Any five) 15


a) Define time and space conplexity.
b) What are the commonly used asymptotic notations.
c) Compare linear and non-linear data structures.
d) What are the diferent 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 terninologies node, height of node, depth of node and height of tree.
g) Define Hash table.
08
Q.2 a) Write PUSH and POP algorithms of stack using array. 07
b)What is doubly linked list? Explain insert operation in doubly linked list.
08
Q3 a) Compare stack and Queue using array. 07
b) Explain enqueue ,dequeue , underflow and overflow operations using array
for circular queue.

Q.4 a) Evaluate the following postfix expression using stack table.


623+-382/+*2A
(note: A stands for power and all operands are single digit).
b) What is Binary Search Tree (BST)? Construct aBST for the ollowing. 07
numbers: 47, 55, 23, 17, 39, 11, 50,9, 19, 74, 33, 28
Show all the steps. Write its preorder traversal.

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

Q.6 a) Explain Quick sort and marge sort data structure.


b) Explain linear search and binary search with 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

Day &Date Subject Name Time Code Max. Marks


Semester

Thus say Data Structures -00 34341I 75

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.

Q.2 a)Write PUSH and POP algorithms of stack using array.


b)What is doubly linked list? Explain insert operation in doubly linked list. 07

O8
Q3 a) Compare stack and Queue using array.
b) Explain enqueue ,dequeue, underflow and overtlow operations using array 07

for circular queue.


0.4 a) Evaluate the following postfix expression using stack table.
623+-3 82/+2A
(note: Astands for power and all operands are single digit). following.
b) What is Binary Search Tree (BST)? Construct a BST for the 07
33, 28
numbers: 47, 55, 23. 17, 39, I1, 50,9, 19, 74,
Show all the steps. Write its preorder traversal.
0.5. a)What is B tree ? How can you perform insertion and deletion in B tree. 08

Explain with proper example.


b) Write bubble sort algorithm with proper example. 07

Quick sort and marge sort data structure. 08


Q0a)b) I iear search and binary search with exanple. 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.6 a) What is hashing? Explain linear probing with exxample.


b) Write an iterative algorithm for preorder traversal of tree. Find
preorder and postorder of inorder, (
following tree.

0.7 a)What is circular inked list?


circular singly linkcd list. WriteWrite steps to insert a node at the
leftmost position in head
linked circular list steps to insert at ot
b) Wrine the BFS
doubly
algorithm and calculate BFS and DFS
of given graph
example
a node from doubly
linkcd list. Comment on
Write an algorithm to delete
b)
complexity of algorithm.
clement as pivot
a) Sort following clements using Quick sort. Consider first
clement.
70 20 35 46 10 25
b) Write and explain heapify procedure with proper example.

Q.6 a) What is hashing? Explain linear probing with example.


b) Write an iterative algorithm for preorder traversal of tree. Find inorder,
preorder and postorder of following tree.

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.

clements using Quick sort. Consider first element as pivot


Q.s Sort following
clement.
70 20 3S 46 10 25
b) Write and explain heapify procedure with proper example.

Q.6 a) What is hashing? Explain linear probing with example.


b) Write an iterative algorithm for preorder traversal of tree. Find inorder,
preorder and postorder of following tree.

Q.7 a) What is circular linked list? Write steps


circular singly to
linked list. Writesteps insert insert
a node at
linked cicular list. to at leftmost the head of
b) Write the BFS
position in doubly
algorithm and calculate BFS
and DFS of
given graph.
BACHELOR OF TECHNOLOGY (New/Old Course)
Max.
Day & Date Semester Subject Name Time Code
Marks

oi2l2o2 Data Structure & Algorithns 34341|

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)

c) Generate binary scarch tree offollowing data. (3)


30 43 11 73 28 7

dy Illustrate Depth Fist Search. (3)


e) What is availability stack? Write steps to get a new node from availability (31
stack.

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.1 a) Calculate prefix and suffix of the expression A"B+CD (3)


b) Define asymptotic upper bound. Draw diagram illustrating it. (3)
c) Generate binary search tree of following data. (3)
30 43 I| 73 28 7

d) Illustrate Depth First Search. (3)


What is availability stack? Write steps to get a new node fronm availability (3)
stack.

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.

QL Answer the following. (Any three) 15.

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;

b) What is the role of stack in recursion? Explain with suitable example.


c) Explain linked list representation of a binary tree with suitable example.
d) Define BST. Also draw different BST"s for 3 numbers 10, 20, 30 by considering
them in different scquence.

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

b) List out different advantages &disadvantages of circular linked list.

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

b) Compare Selection sort, Bubble sort and Inscrtion sort algorithms.


OS a) What is AVL tree? Also find the balance factors for every node of the following binary tree. Day
Explain LL Rotation with suitable example. 10.

Instr

Q.N

Fig, A) Binary Tree


b) Write the difference between tree and Binary tree.

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.

Fig. B) Directed graph


b) List out different applications of graph. S.

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

b)Compare linear search and binary search with example.S 07


Q.7 a) Explain adjacency list and adjacency matrix representatíon w.r.t graph 08
b) Explain BFS algorithm in detail and illustrate using an example. 07

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

Instructions:1) Question 1 is Compulsory.


2) Solve any four questions from remaining six questions.
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.
f) Explain tree terminologies node, height of node and leaf node.
g) Define Hashing
Q.2 a) Write PUSH and POP algorithms of stack using array. 08
Linklist.
b) What are the applications of data structures? Compare Array vs
07

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

Instructions:1) Question 1 is Compulsory.


2) Solve any four questions from remaining six questions.

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.3 a) Compare stacks and Queues. 08


b) Write and explain the algorithm to deletea node from the list 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

Q.5 a) lustrate with an example Priority queue. 08


42 07
b) Write merge sort algorithm with proper example.
PM

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

Compare linear search and binary search with example. 07

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

You might also like