Sunday, 29 October 2017

Question Bank of Data Structure: Set 3

Q.1 Given a set of input representing the nodes of a binary tree, write a non recursive algorithm that must be able to output the three traversal orders. 
Q.2 Make a Binary Search Tree for the following sequence of numbers 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48. Traverse the tree in Pre-order, In-order and Post-order.
Q.3 Two Binary Trees are similar if they are both empty or if they are both nonempty and left and right sub trees are similar. Explain.
Q.4 The degree of a node is the number of children it has. Show that in any binary tree, the number of leaves are one more than the number of nodes of degree 2.
Q.5 Taking a suitable example explains how a general tree can be represented as a Binary Tree.
Q.6 What is the maximum total number of nodes in a tree that has N levels? 
Q.7 Write the non-recursive algorithm to traverse a tree in preorder.
Q.8 Write a Binary Search program.
Q.9 What are expression trees? Represent the following expression using a tree. 
Q.10 How do you rotate a Binary Tree? Explain right and left rotations with the help of an example.
Q.11 Taking a suitable example explains how a general tree can be represented as a Binary Tree.
Q.12 How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3? 
Q.13 How will in-order, pre-order and post-order traversals print the elements of a tree?
Q.14 Which one is faster? A binary search of an ordered set of elements in an array or a sequential search of the elements.
Q.15 Write a non recursive algorithm to traverse a binary tree in in-order.
Q16 Construct a binary tree whose nodes in in-order and pre-order are given as follows:  In-order : 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50, Pre-order: 20, 15, 10, 18, 17, 30, 25, 40, 35, 38, 50
Q.17 Given the following in-order and pre-order traversal reconstruct a binary tree, In-order sequence D, G, B, H, E, A, F, I, C, Pre-order sequence A, B, D, G, E, H, C, F, I
Q.18 Make a Binary Search Tree for the following sequence of numbers. 45,32,90,34,68,72,15,24,30,66,11,50,10 Traverse the Binary Search Tree created in Pre-order, In-order and Post-order.                     
Q.19  What is a Binary Tree? What is the maximum number of nodes possible in a Binary Tree of depth d. 
Q.20 Construct a complete binary tree with depth 3 for this tree which is maintained in memory using linked representation. 
Q.21 Prove the hypothesis that “A tree having ‘m’ nodes has exactly (m–1) edges or branches”.
Q.22 Construct the binary tree for the following sequence of nodes in pre-order and  in-order respectively. Pre-order : G, B, Q, A, C, K, F, P, D, E, R, H, In-order: Q, B, K, C, F, A, G, P, E, D, H, R
Q.23  What is a height balanced tree? Explain how the height is balanced after addition/deletion of nodes in it?
Q.24  Let a binary tree ‘T’ be in memory. Write a procedure to delete all terminal nodes of the tree.
Q.25  Consider the following eight numbers 50, 33, 44, 22, 77, 35, 60 and 40. Display the construction of the binary by inserting the above numbers in the given order.
Q. 26 Explain the following terms with respect to Binary trees (i) Strictly Binary Tree (ii) Complete Binary Tree (iii) Almost Complete Binary Tree.

Mukesh Rajput

No comments:

Post a Comment

Mukesh Rajput