Data StructuresQuestion Bank Module 4 Final
Data StructuresQuestion Bank Module 4 Final
1 1.Differentiate between complete binary tree and full binary tree. Give examples 3 2 CO3
for each.
3. Differentiate between binary tree and binary search tree. Give examples 3 2 CO3
for each.
2 1. Write the output of inorder, preorder & postorder traversals on the following
tree.
3 3 CO3
2. Write the output of inorder, preorder & postorder traversals on the following
tree.
3 3 CO3
3. Write the output of inorder, preorder & postorder traversals on the following
tree.
3 3 CO3
3 1. Write a recursive algorithm for preorder traversal in a binary tree. Give an example. 3 2 CO3
2. Write a recursive algorithm for postorder traversal in a binary tree.Give an example. 3 2 CO3
3. Write a recursive algorithm for inorder traversal in a binary tree.Give an example. 3 2 CO3
4 1. Create a Binary Search Tree for the following values 62, 14, 96, 12, 105, 3, 75,
3 3 CO3
22, 87, 32, 20, 13, 102, 68, 125.
2. Create a Binary Search Tree for the following values 73, 25, 98, 23, 108, 9, 75,
3 3 CO3
22, 87, 32, 20, 13, 109, 66, 120.
3. Create a Binary Search Tree for the following values 72, 25, 109, 24, 115, 13, 85,
3 3 CO3
33, 89, 42, 26, 31, 112, 67, 128.
3 2 CO3
3 2 CO3
6 1.Define graph. Explain any one graph representation method with examples. 3 2 CO3
2. Define graph. Explain the linked representation method with examples. 3 2 CO3
3. Define graph. Explain the sequential representation method with examples. 3 2 CO3
3
1.b Explain the term Complete Graph with an example. 5
2.a Explain the recursive algorithms for the Inorder, Preorder, Postorder traversals of
the given tree.
8
2.b What is a complete graph? Find out the number of edges in a complete graph with
6
5 nodes.
3.a Write recursive algorithms for all three traversals on a binary tree. Illustrate the
algorithms using the given example.
1 a. How to represent a binary tree using Arrays ? Construct a binary tree from the
8 following elements arranged in an array A[1:15] as:
10
1.b Explain any two properties of the Binary tree with the help of an example. 4
2.a How to represent a binary tree using Arrays ? Construct a binary tree from the
10
following elements arranged in an array A[0:14] as:
2 b. Prove any two properties of the Binary tree with the help of an example. 4
3 a. How to represent a binary tree using Arrays ? Construct a binary tree from the
following elements arranged in an array A[1:15] as:
10
1b. Write the post order traversal of a BST whose pre order traversal is 15, 10, 8, 12,
4
20, 16, 25.
2a. What is a Binary Search Tree (BST)? Show the creation of the binary search tree
after adding each of the following values in order: 8, 3, 10, 1, 6, 14, 4, 7, 13. 10
Show the steps for deleting the value 10 from the above resultant tree. 3 CO3
2b. Create the BST and write the post order traversal whose pre order traversal is 15,
4
10, 8, 12, 20, 16, 25.
3a. Show the structure of the binary search tree after adding each of the following
values in that order: 2, 5, 1, 7, 10, 9, 11, 6. What is the height of the created 10
tree?
3b. Create the BST and write the post order traversal whose pre order traversal is 25,
4
20, 18, 22, 30, 26, 35.
1a. Write an algorithm to delete a node from a Binary Search Tree. Illustrate each
14
10 case with an example.
2a. Write an algorithm to delete a leaf node from a Binary Search Tree. Illustrate it
10
with an example.
3a. Write an algorithm to delete an intermediate node with two children from a Binary
10
Search Tree. Illustrate it with an example.
1 a. Explain BFS with the help of an algorithm/pseudo code. Perform BFS on the
11 given graph, starting from node ‘C’ and follow chronological order.
10
2a. Write an algorithm to perform DFS in a graph.Perform DFS on the given graph,
10
starting from node 0 and follow numerical order.
2.b With the help of examples, explain the use of graph in computer science. 4
3.a write algorithms to perform DFS and BFS on the given graph. Illustrate the
algorithms on the following graph, starting from node ‘C’ and follow chronological
order.
14
1a. Write an algorithm to insert a new element to the existing BST. Consider the
12 following tree and show the steps to insert 68 to this BST.
10
1.b Prove that insertion of a new node to a BST runs in O(log N). 4
2 a. Write an algorithm to insert a new element to the existing BST. Consider the
following tree and show the steps to insert the following numbers to the tree. 14
28, 42, 72.
3.a Write an algorithm to insert a new element to the existing BST. Show the steps to
10
insert 35 to an existing BST with data members 15,40,32,12.
3.b With the help of an example prove that searching in a BST runs in O(log N).
4