Ice 2111

You might also like

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

Bangladesh Army University of Engineering & Technology (BAUET)

Department of Information and Communication Engineering (ICE)


B.Sc. Engineering 2nd Year 1st Semester, Referred/Improvement Examination, Summer-2021
Course Code: ICE 2111 Course Title: Data Structure and Algorithms
Full Marks: 40 Time:02 Hours
N.B.:
1. Figures shown in the right margin indicate full marks
2. Answer Four questions, taking Two from each section including Q.1
3. Use separate Answer script for each section.
4. Assume reasonable data if necessary.

Section-A

Q.1 (a) Define Algorithm. 1

(b) Explain importance of data structure. 𝟒

(c) Analyze the time complexity of GCD algorithm. 𝟓

Q.2 (a) Define Linked list in your own words. 1

(b) Write an algorithm to solve whether a string s has more vowels than consonants. 4

(c) Design an algorithm that takes two two-dimensional integer arrays and adds them component 5
wise.

Q.3 Consider the following Queue of characters, where Queue is allocated 6 memory cells.
CQ: C, D, F, K, __, __, __, __.
(a) Define circular queue with example. 1

(b) Illustrate the following operations: PUSH (Queue, B), PUSH (Queue, A), PUSH (Queue, E), 4
PUSH (Queue, T), POP (Queue, ITEM), POP (Queue, ITEM), POP (Queue, ITEM).

(c) Design algorithm for ENQUEUE and DEQUEUE to detect underflow and overflow of a 5
queue.

Section-B

Q.4 (a) Define binary search tree. 1

1
(b) Consider the following tree and calculate tree traversal in inorder, preorder and postorder. 5

(c) Determine a (single) binary tree T, such that: 4


a. Each internal node of T stores a single character.
b. A preorder traversal of T yields EXAMFUN.

An inorder traversal of T yields MAFXUEN.

Q.5 (a) Define graph data structure. 1

(b) Calculate a simple, connected, undirected, weighted graph with 8 vertices and 16 edges, each 5
with unique edge weights. Illustrate the execution of Kruskal’s algorithm on this graph.

(c) 𝟒

Suppose “1” is starting node, apply Breath First Search in graph shown above.

Q.6 (a) Define binary searching algorithm. 1

(b) Suppose an array A contains 8 elements as follows: A= {87, 43, 54, 21, 98, 32, 76, 65}. Apply 5
the selection sort algorithm to A.

(c) After sorting array “A” apply binary search algorithm to find out 99. 4

You might also like