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

Spring 23

The document is the final exam for a data structures and algorithms course. It contains 4 questions assessing various data structures and algorithms concepts. Question 1 involves infix to postfix conversion, stack evaluation, and tower of Hanoi recursion. Question 2 involves graph representations, DFS, and topological sorting. Question 3 involves binary tree traversal and level ordering. Question 4 involves binary search tree operations and appropriate data structures for different applications.

Uploaded by

Partho Protim
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)
25 views

Spring 23

The document is the final exam for a data structures and algorithms course. It contains 4 questions assessing various data structures and algorithms concepts. Question 1 involves infix to postfix conversion, stack evaluation, and tower of Hanoi recursion. Question 2 involves graph representations, DFS, and topological sorting. Question 3 involves binary tree traversal and level ordering. Question 4 involves binary search tree operations and appropriate data structures for different applications.

Uploaded by

Partho Protim
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

United International University (UIU)

Dept. of Computer Science and Engineering (CSE)


Final Examination Trimester: Spring 2023
Course: CSE 2215 Data Structure and Algorithms-I
Total Marks: 40, Time: 2 hours

(Any examinee found adopting unfair means will be expelled from the trimester /
program as per UIU disciplinary rules)

There are FOUR questions. Answer all of them. Figures in the right-hand margin
indicate full marks.

1. a) Convert the following infix expression into postfix using a STACK. [3]
Infix expression: a↑2-(b+c/d*a+b)

b) Evaluate the postfix expression, a b – c d * + for a=2, b=3, c=2 and d=1 using a [2]
STACK

c) Find a recursive algorithm for TOWER OF HANOI using one intermediate pillar/peg [3]
and show simulation for n = 3, where n is the number of disks.

d) How is overflow checking in a QUEUE is done when it is implemented by an array? [2]

2. a) Draw a directed acyclic graph using six vertices [1]

b) Construct an Adjacency Marix and an Adjacency List for the graph in Ques. 2(a). [3]
Show the memory requirement for each of the cases.

c) Sketch a sparse and a dense graph using five vertices. [2]

d) Show the depth first search (DFS) sequence from the sparse graph of 2(c) assuming [2]
any one is the starting vertex.

e) Write an algorithm for Topological Sorting. Show the simulation of your algorithm [3]
using the graph in Ques. 2(a).

3. a) Draw a binary tree that contains six nodes. [1]

b) Traverse the binary tree of Ques. 3(a) using the preorder, inorder, postorder and level [3]
order techniques. Level each of the nodes of the tree. Also find the height of the tree
using level.

c) Show the status of a QUEUE and a Priority QUEUE (Data in descending Order) for [3]
the following operations, where both QUEUEs are implemented by an array of size,
m=3. Here, Enqueue and Dequeue mean insert and delete respectively

Enqueue(23), Enqueue(34), Dequeue(), Enqueue(40), Enqueue(35), Dequeue()

d) Sort the following data in descending order using the heapsort algorithm. [3]
10 18 17 20 15

1
4. a) Construct a binary search tree (BST) using the nodes [3]
10 20 30 40 50 60 70 80

Also show the insertion and deletion of 75 and 40, respectively in/from the BST.

b) Represent a binary tree using a one-dimensional array and a linked list. [2]

c) S1 = {10, 20, 30, 40} and S2= {50, 60, 70} are disjoint sets, where the maximum of [1]
both sets are the representatives. How can you check 10 and 50 are not in the same set?

d) Which Data Structures are appropriate to implement the following and why? [3]

i) Different areas of Dhaka City with distances


ii) Line in front of a Doctor’s Chamber
iii) Reversing a String

You might also like