0% found this document useful (0 votes)
149 views3 pages

DSF Unit III Question Bank

The document contains 19 questions related to trees and binary trees. The questions cover topics such as defining binary search trees, drawing BSTs from given data, performing traversals on BSTs, representing binary trees using arrays and pointers, threading binary trees, searching and inserting elements in BSTs, and constructing binary trees from traversals. Additional questions cover more advanced topics like expression trees, deleting nodes from BSTs, and counting leaf nodes.

Uploaded by

shubham gandhi
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)
149 views3 pages

DSF Unit III Question Bank

The document contains 19 questions related to trees and binary trees. The questions cover topics such as defining binary search trees, drawing BSTs from given data, performing traversals on BSTs, representing binary trees using arrays and pointers, threading binary trees, searching and inserting elements in BSTs, and constructing binary trees from traversals. Additional questions cover more advanced topics like expression trees, deleting nodes from BSTs, and counting leaf nodes.

Uploaded by

shubham gandhi
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/ 3

Unit III: Trees

Question Bank for Unit Test II


(SE-IT 2003)
1. Define a binary search tree. Draw the BST for the given data : [6M]
100, 170, 55, 95, 125, 130, 60, 35, 180, 30, 200.
Write down all the three traversals for the above tree. (SE-IT 2003)

2. For the tree drawn in Q.1a) perform in order threading of the tree and write
the non-recursive algorithm for post order traversing of the tree. [6M]

3. Define the following terms w.r.t. trees :[ 6M]


i) Height of tree
ii) Predecessor and successor of a node
iii) Leaf node.
4. Elaborate on the different ways in which a binary tree can be represented.
Draw the binary tree from the given sequential representation.(6M)

5. With Example define following terms. [May/June 2014]


i) Complete Binary tree
ii) Strictly Binary tree
iii) Full Binary Tree
iv) Extended Binary tree
v) Binary search tree

6. For the binary tree representation as an array, perform in-order threading for the
tree. [May/June 2014]
A B C D E G H -- -- F -- -- -- J K -- -- -- ---- -- -- -- -- -- -- -- L -- --[04]
7. Write a function to search an element in BST [6M] Oct 2010
8. Write an algorithm to implement non-recursive in-order traversal
9. of binary tree.[6]Oct 2010
10. Write a function to insert an element in BST. [6M]Oct 2010
11. Write a C/C++ function to print given binary tree in BFS (without using
recursion). [8]
12. What is binary search tree ? Draw binary search tree for the following data :
[4M]
10, 08, 15, 12, 13, 07, 09, 17, 20, 18, 04, 05.
13. What is threaded binary tree ? What are the advantages of threaded binary tree
over normal binary tree ? Draw an in-order threaded binary tree upto three
levels. [6]
14. Write a pseudo ‘C’ function to print given in-order threaded binary tree.
Display the tree in inorder without using extra data structures. [8]

15. What is binary tree ? How is it different than a basictree ? Explain with figures.
[5]
16. Convert the following tree to Binary tree step bystep :

17. Write ‘C’ functions for all three binary tree traversals nonrecursively.
[6M]

18. Construct a binary tree from the given traversals : [6]


Pre-order : * + a – b c / – d e – + f g h
In-order : a + b – c * d – e / f + g – h

19.For the following data draw binary tree. Show all steps : [6]
50 80 30 20 100 75 25 15 68

Extra Questions
1. Define the following terms with respect to trees:
a. Complete Binary Tree
b. Predecessor and Successor
c. Forest
d. OBST
e. Depth of a tree
f. Binary Search Tree
g. Strictly Binary Tree
h. Binary Tree
2. Draw the BST for the given set of data values: JAN, FEB, MAR, APR, MAY, JUN, JULY, AUG, SEP,
OCT, NOV, DEC. write a pseudo code to delete a rightmost node from a BST.
3. What are the advantages of threaded binary tree over normal binary tree? Write a pseudo code
for insertion and deletion of element in a threaded binary tree.
4. Write the recursive algorithm for finding the height of tree.
5. Write the recursive and non-recursive algorithm to find the post order traversal for binary tree.
6. Define threaded binary tree and explain with example.
7. Write a function for inorder traversal of TBT.
8. “Is it worthwhile to use threaded trees to avoid recursive post-order or pre-order traversal?”
Justify your answer.
9. Write a pseudo code for deletion of a node from a binary search tree. Simulate your algorithm
with BST of 10 nodes and show the deletion process. Your simulation should show deletion of
interior node and not just for leaf nodes.
10. Explain expression trees with one example.
11. Write a function to search a number in BST.
12. For the following numbers create binary search tree and show in-order, Preorder and post order
traversals
56, 12, 34, 67, 89, 60, 65, 19, 23, 63, 78
13. Construct a binary tree from following traversals:
Post Order: H D I E B J F K L C G A
Inorder: H D B I E A F J C K G L
14. Write a pseudo code to display the preorder of the constructed binary tree.
15. Write a ‘C’ function to count the number of leaf nodes of a tree (Recursive).

You might also like