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

Unit I

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

Unit I

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

Dr.

Mahalingam College of Engineering and Technology


Department of Computer Science and Engineering
Question Bank
Course code &Title:19CSCN1401 / DATA STRUCTURES AND ALGORITHM ANALYSIS II Semester: IV
Course Category:BS/ES/PC/PE/OE Level of Course:Introductory / Practice/Mastery
CO.No. Course Outcome CO Blooms Level
1 Perform various operations on Binary trees and Heaps for real world applications. Apply

S.No. Question Question Easy/


Blooms Level Moderate/
Difficult
Part A
1. Write any four applications of binary heap. R Easy
2. Define the terms ‘height’ and ‘sibling’ in the context of Trees. U Easy
3. Determine the height, depth and degree of the given tree. U Easy

B D
C

E F G H J K

M P
L N O
4. Identify the correct statement and give suitable illustration: U Easy
 The height of a node is equal to its depth.
 The height of a tree is equal to its depth.
5. Summarize the advantages of binary trees over arrays. U Easy
6. Illustrate linked and sequential representation of binary trees. Compare both representations. U Easy
7. Identify the maximum and minimum number of nodes that can be present in a Complete Binary U Easy
tree of height 3.
8. Construct the binary tree representation for the general tree given below. Ap Moderate
A

B D
C

E F G H J K

M P
L N O

9. Array implementation is suitable for which of these tree structures and Why? Ap Moderate
a. Skewed binary tree b. Binary tree c. Complete Binary tree d. Full Binary tree
10. Choose the suitable tree traversal technique for: Ap Moderate
a. Print the contents of a file directory
b. Deleting all nodes in a tree
11. Draw a binary tree if the pre-order traversal is + + a * b c * + * d e f g. Ap Moderate
12. Draw an expression tree for A*B+C*D+E. Ap Moderate
13. Each leaf of the given expression tree can either be 0 or 1. The maximum possible value of the Ap Moderate
expression represented by the tree is ___. [GATE 2014]

14. What type of Games is best represented using Game trees? Justify. Ap Moderate
15. A Chess playing application usually wins against an average human player. How is this possible? Ap Moderate
16. Build a decision tree to find the maximum of three numbers. Ap Difficult
17. Construct a min-heap using an efficient method for the given list: 1,8,6,5,3,7,4. Ap Difficult
18. Determine the minimum number of interchanges needed to convert the array 〈89, 19, 50, 17, 12, Ap Difficult
15, 2〉into a max-heap.
19. Identify the approach used to construct a heap within linear time bound and justify your answer. Ap Difficult
20. A min-heap usually permits only DeleteMin operation. Frame a strategy to delete any value from Ap Difficult
the heap.
Part B (15 marks)
1. Define Heap and state its properties. Explain the Insert and DeleteMin operations on a Heap with U Easy
algorithm and example.
2. Given the following tree, Find the U Easy
(i) Height of the Tree
(ii) Depth of the Tree
(iii) Sibling of Node H
(iv) Depth of Node M
(v) Height of Node B
(vi) Path from A to M
(vii) Length of the path from A to K

3. Construct a binary tree whose nodes in inorder and preorder are given as follows: Ap Moderate
Inorder : 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50
Preorder: 20, 15, 10, 18, 17, 30, 25, 40, 35, 38, 50
Reason whether multiple binary trees can be constructed from the given sequences with necessary
pseudo-code for all three tree traversals.
4. Suggest suitable implementation / storage scheme for each of the following: Ap Moderate
 Complete Binary Tree
 Full Binary Tree
 Skewed Tree
 Binary Tree
 General Tree
Give suitable illustrations and justification.
5. Construct the expression tree for the input: abc*+de*f+g*+ compute the solution given that a = 5, b Ap Difficult
= 3, c= 2, d = 4, e = 6, f = 7, g = 1.
6. Sort the given set of values using Heapsort techniques with necessary pseudocode Ap Difficult
19, 12, 16, 1, 4, 7, 23, 56, 32, 13, 45, 60
Part B (8 marks)
7. Construct a decision tree from the given data to decide whether to schedule a Tennis match on a U Easy
particular day.

Day Weather Humidity Wind Play?

1 Sunny High Weak No

2 Cloudy High Weak Yes

3 Sunny Normal Strong Yes

4 Cloudy High Strong Yes

5 Rainy High Strong No

6 Rainy Normal Strong No

7 Rainy High Weak Yes

8 Sunny High Strong No

9 Cloudy Normal Weak Yes

10 Rainy High Strong No


8. Construct a tree given the following parameters: Height of tree = 4; degree = 5; Each node (except U Easy
root) must have minimum 2 siblings.
9. Explain any two applications of trees. U Easy
10. Devise algorithms to compute the height of a binary tree Ap Moderate
11. Sort the following set of numbers in ascending order by constructing the best suited heap: 98, 32, Ap Moderate
67, 2, 14, 55, 23, 49, 76, 80. Write and explain the algorithm used.
12. Devise algorithms to find the total number of nodes in a binary tree. Ap Moderate
13. Construct a Decision tree for sorting three numbers and explain its working. Ap Difficult
14. Complete the Game tree for the Tic Tac Toe game from the following board position given that X Ap Difficult
plays next. Identify the winning strategy for each player.
X O
O O
X X
Part B (7 marks)
15. Demonstrate a Java program given the root to a binary tree, count the total number of nodes. U Easy
16. Demonstrate a Java program to return the deepest node given the root of the binary tree U Easy
17. Demonstrate a Java Program to print the nodes of binary tree using various traversal techniques. U Easy
18. Construct a Max heap by repeated insert operations and perform tree traversals for the following Ap Moderate
values: 44, 30, 50, 22, 60, 55, 77, 56, 19, 35, 7, 100
19. Construct Min heap by Build Heap method and perform tree traversals for the keys: Ap Moderate
95,80,70,88,64,43,98,27,33,78,50,15
20. Develop an algorithm for constructing an expression tree with suitable example. Ap Moderate
21. Sketch the values in descending order by performing repeated DeleteMin operation for the given Ap Difficult
heap: 15, 27, 43, 33, 50, 70, 98, 88, 80, 78, 64, 95
22. Sketch the values in ascending order by performing repeated DeleteMax operation for the given Ap Difficult
heap
100, 56, 77, 50, 35, 60, 50, 22, 19, 30, 7

You might also like