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

Basic Data Structure and Algorithms Koe045

This document is an examination paper for a BTECH course on Basic Data Structures and Algorithms, consisting of multiple sections with various questions. It covers topics such as time complexity, linked lists, binary trees, sorting algorithms, and graph traversal methods. The exam has a total duration of 3 hours and is worth 100 marks.

Uploaded by

lokeshrawat342
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Basic Data Structure and Algorithms Koe045

This document is an examination paper for a BTECH course on Basic Data Structures and Algorithms, consisting of multiple sections with various questions. It covers topics such as time complexity, linked lists, binary trees, sorting algorithms, and graph traversal methods. The exam has a total duration of 3 hours and is worth 100 marks.

Uploaded by

lokeshrawat342
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Printed Page: 1 of 2

Subject Code: KOE045


0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

BTECH
(SEM IV) THEORY EXAMINATION 2021-22
BASIC DATA STRUCTURE AND ALGORITHMS

Time: 3 Hours Total Marks: 100


Note: Attempt all Sections. If you require any missing data, then choose suitably.

SECTION A
1. Attempt all questions in brief. 2x10 = 20
Qno Questions CO
(a) Determine the worst-case time complexity of inserting n elements into an 1
empty linked list, if the linked list needs to be maintained in sorted order?
(b) What do you understand by time complexity of algorithm? Explain BIG Oh 1
notation with bubble sort example.
(c) Find out number of items in following cases. 2
i. top=5, size=10 (Stack)
ii. rear=5, front=2, size=10 (Queue)
iii. rear=2, front=5, size=10 (Circular Queue)
(d) Compute the result evaluating the postfix expression 15 5 + 12 5 / * 5 - 2
is_____.
(e) Illustrate when a sorting technique is called stable? 3
(f) Consider the array A = <14, 11, 13, 12, 6, 9, 10, 12, 8, 7>. After building 3
heap from the array A, determine the depth of the heap and the right child of
max-heap. (Root is at level 0).
90

2
13
(g) The post order traversal of a binary tree is 8,9,6,7,4,5,2,3,1. The in order 4
_2

traversal of the same tree is 8,6,9,4,7,2,5,1,3. The height of a tree is the length

2.
of the longest path from the root to any leaf.
P2

24
Predict the height of the binary tree is_________.
2E

(h) The following numbers are inserted into an empty binary search tree in the 4

5.
given order: 11, 6, 3, 5, 15, 12, 16. Calculate the height of the binary search
.5
P2

tree (the height is the maximum distance of a leaf node from the root)?
17
(i) Differentiate between Graph and tree. 5
Q

|1

(j) Describe multigraph and Digraph. 5


0

SECTION B
4
0:

2. Attempt any three of the following: 10x3 = 30


Qno Questions CO
:3
13

(a) What do you mean by linked list? Discuss structure of all possible types of 1
linked list.
2

(b) Describe tail recursion and non-tail recursion with suitable example. Also 2
02

discuss the solution for Tower of Hanoi problem for 4 discs.


(c) What are the possible traversals of a tree? Write their recursive algorithms 3
-2

with suitable example.


08

(d) Use Heap sort algorithm to sort the given array and write all the steps: 82, 5
4-

90,10, 12,15, 77,55


(e) Demonstrate Breadth First Search (BFS) algorithm to traverse a graph. 4
|0

SECTION C
3. Attempt any one part of the following: 10x1 = 10
Qno Questions CO
(a) Write structure of linked list that can be used to represent a polynomial of the 1
following type 4x4 y4-9x3 y2+6x2-y+8. Write an algorithm to find addition
of two polynomials
(b) What is Sparse matrix? Explain how a Sparse matrix can be implemented by 1
using the linked list?

QP22EP2_290 | 04-08-2022 13:30:40 | 117.55.242.132


Printed Page: 2 of 2
Subject Code: KOE045
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

BTECH
(SEM IV) THEORY EXAMINATION 2021-22
BASIC DATA STRUCTURE AND ALGORITHMS

4. Attempt any one part of the following: 10x1 = 10


Qno Questions CO
(a) State the algorithm to evaluate the postfix expression. And apply it on 2
following expression
(i) ABD+*E/FGHK/+*–
(ii) 10 5 + 60 6 / ∗ 8 −
(b) Two matrices M1 and M2 are to be stored in arrays A and B respectively. 2
Each array can be stored either in row-major or column-major order in
contiguous memory locations. The time complexity of an algorithm to
compute M1× M2 also writes a program to complete above said function.

5. Attempt any one part of the following: 10x1 = 10


Qno Questions CO
(a) Do the following operations for constructing a BST 3
i) 45, 37, 98, 76, 13, 39,105, 80, 5 insert element as per their occurrence.
ii) Delete 39 and 45 respectively
Now Traverse final BST in In order, Preorder and post order.
(b) What is Thread binary tree? Explain the significance of threaded binary tree? 3
90

2
13
6. Attempt any one part of the following: 10x1 = 10
_2

Qno Questions CO

2.
P2

(a) Apply Kruskal’s and Prism’s algorithm to find the minimum spanning tree in 4

24
the following given graph.
2E

5.
.5
P2

17
Q

|1
4 0
0:
:3
13
2
02
-2

(b) Write an algorithm for topological sort. Give an example 4


08
4-

7. Attempt any one part of the following: 10x1 = 10


Qno Questions CO
|0

(a) Write quick sort algorithm and its analysis. Use Quick sort algorithm to sort 5
9, 11, 10, 1, 60, 10, 6, 25, 40, and 30. Is it a stable sorting algorithm? Justify.
(b) Write merge sort algorithm and its analysis. Use merge sort algorithm to sort 5
9, 11, 10, 1, 60, 10, 6, 25, 40, and 30. Is it a stable sorting algorithm? Justify.:

QP22EP2_290 | 04-08-2022 13:30:40 | 117.55.242.132

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy