Bcs301 Data Structure
Bcs301 Data Structure
BTECH
(SEM III) THEORY EXAMINATION 2023-24
DATA STRUCTURE
TIME: 3HRS M.MARKS: 70
Note: 1. Attempt all Sections. If require any missing data; then choose suitably.
SECTION A
2
13
a. Write a Pseudo code that will concatenate two linked lists. Function should 7 1
_2
2.
have two parameters, pointers to the beginning of the lists and the function
P2
24
should link second list at the end of the first list.
b. Write an algorithm to convert a valid arithmetic infix expression into an 7 2
4D
5.
equivalent postfix expression. Trace your algorithm for following infix
.5
P2
expression.
17
A+B*C-D/F
Q
|1
e. Consider the following graph and using Dijkstra Algorithm find the shortest 7 5
:2
path.
13
4
02
-2
03
6-
|1
SECTION C
3. Attempt any one part of the following: 7x1=7
a. Each element of an array Data [20][50] requires 4 bytes of storage. Base 7 1
address of Data is 2000. Determine the location of Data [10][10] when the
array is stored as:
(i) Row major
(ii) Column major
1|Page
QP24DP2_290 | 16-03-2024 13:20:56 | 117.55.242.132
Printed Page: 2 of 2
Subject Code: BCS301
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0
BTECH
(SEM III) THEORY EXAMINATION 2023-24
DATA STRUCTURE
TIME: 3HRS M.MARKS: 70
b. How will you create link list representation of a polynomial. Explain it with 7 1
the suitable example.
4. Attempt any one part of the following: 7x1=7
a. Write an algorithm to evaluate an arithmetic expression using stack and show 7 2
how the expression 3*(5-3) will be evaluate.
b. A double ended Queue (deque) is a linear list in which additions may be made 7 2
at either end. Obtain a data representation mapping a deque into one
dimensional array. Write C function to add and delete elements from either
end of deque.
5. Attempt any one part of the following: 7x1=7
a. Write a C program for sorting 100 integer numbers wring selection sort 7 3
procedure. Discuss the worst-case time complexity of the algorithms.
b. Write a program in C language to implement binary search algorithm. Also 7 3
discuss the average behavior of the algorithm.
6. Attempt any one part of the following: 7x1=7
90
a. If E and I denotes the external and internal path length of a binary tree having 7 4
2
13
n internal nodes then show that E=I+2n.
_2
b. Suppose character a, b, c, d,e,f has probabilities 0.07, 0.09, 0.12, 0.22, 0.23, 7 4
2.
P2
0.27 respectively. Find an optional Huffman code and draw the Huffman tree.
24
What is the average code length?
4D
5.
7. Attempt any one part of the following: 7x1=7
.5
P2
a. Find the minimum spanning tree using Prim’s algorithm for the graph shown 7 5
17
Q
below: -
|1
5 6
0:
:2
13
4
02
adjacency matrix.
6-
|1
2|Page
QP24DP2_290 | 16-03-2024 13:20:56 | 117.55.242.132