Btech Oe 4 Sem Basic Data Structure Algorithms Koe 045 2023

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

Printed Pages:02 Sub Code:KOE045

Paper Id: 238139 Roll No.

B.TECH.
(SEM IV) THEORY EXAMINATION 2022-23
BASIC DATA STRUCTURE & ALGORITHMS
Time: 3 Hours Total Marks: 100
Note: Attempt all Sections. If require any missing data; then choose suitably.

SECTION A

1. Attempt all questions in brief. 2 x 10 = 20


(a) Discuss space and time complexity of an algorithm?
(b) Write the syntax to check whether a given circular queue is full or empty?
(c) Draw a binary Tree for the expression: A * B - (C + D) * (P /Q).
(d) What is the advantage of linked list over an array?
(e) Define transitive closure.
(f) Write an algorithm of bubble sort and its time complexity also.
(g) Write down the various applications of linked list.
(h) Write an algorithm for Breadth First Search (BFS) traversal of a graph.
(i) Differentiate between internal sorting and external sorting.
(j) 90
Discuss about data structure which is used to perform recursion?

2
13
_2

2.
SECTION B
P2

24
2. Attempt any three of the following: 10x 3 = 30
3E

5.
(a) Assume the declaration of multi-dimensional arrays A and B to be,

.5
P2

A (-2:2, 2:22) and B (1:8, -5:5, -10:5)


17
(i) Find the length of each dimension and number of elements in A and B.
Q

(ii) Find the address of element B (2, 2, 3), assuming Base address of B =400 and
|1
there are W=4 words per memory location.
6

(b) Define Stack? Write a C program for array implementation ofa stack.
:1

(c) Write an algorithm for Insertion Sort. Use Insertion sort algorithm, sort the
26

following elements:
2, 8, 7, 1, 3, 5, 6, 4.
:
13

(d) Write the Dijkstra algorithm for shortest path in a graph and also discuss with the
help of suitable example.
3

(e) Construct a Huffman tree for given characters A, B, C, D, E, F, G, H and I


02

having frequencies 15, 6, 7, 12, 25, 4, 6, 1 and 15 respectively. What will be


-2

the code of AHEAD in binary?


08

SECTION C
3-
|0

3. Attempt any one part of the following: 10 x 1 = 10


(a) How to represent the polynomial using linked list Write a C program to
add two polynomials using linked list.
(b) Discuss singly linked list? Write an algorithm to insert a node after agiven node in
singly linked list.

QP23EP2_290 | 03-08-2023 13:26:16 | 117.55.242.132


4. Attempt any one part of the following
following: 10 x 1 = 10
(a) Write an algorithm for converting infix expression into postfixexpression.
Trace your algorithm for infix expression Q into itsequivalent postfix
expression P,
Q: A+(B*C- (D/E^F)*H
(b) Write
rite short note on the following:
(i) Priority Queue
(ii) Circular Queue

5. Attempt any one part of the following


following: 10 x 1 = 10
(a) Define Hashing. Explain midsquare and digit folding method to compute the
hash functionwith
with the help of an example.
(b) Write an algorithm for Quick Sort
Sort. Use Quick sort algorithm, sort thefollowing
the
sequence: 18, 25, 45, 34, 36, 51, 43, 24.

6. Attempt any one part of the following


following: 10 x 1 = 10
(a) Discuss spanning
ning tree
tree. Write down the Kruskal algorithm to obtainminimum
obtainminimu
cost spanning tree. Use Kruskal algorithm to find the minimumcost spanning
tree in the following graph:

90

2
13
_2

2.
P2

24
3E

5.
.5
P2

17
Q

(b) Write down the Floyd Warshall algorithm to solve the all pair shortest path.
|1
Use the Floyd Warshall algorithm to find shortest path among all the vertices in
the given graph:
6
:1
: 26
13
3
02
-2

7. Attempt any one part of the following


following: 10 x 1 = 10
08

(a) Explain B-tree. Write down the properties of it. Cons


Construct
truct a B-tree
B on the
3-

following sequence of inputs:


|0

10,20,35,40,50,60,75,80,95
Assume that the order of the B
B-tree is 3.
(b) Write short note on the following:
(i) Internal and External Sorting
(ii) B+ tree

QP23EP2_290 | 03-08-2023 13:26:16 | 117.55.242.132

You might also like