0% found this document useful (0 votes)
245 views2 pages

ASSIGNMENT-4 Tree

Uploaded by

ashvendra71
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)
245 views2 pages

ASSIGNMENT-4 Tree

Uploaded by

ashvendra71
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

ASSIGNMENT –4

Subject: Data Structure Subject code: BCS-301


Faculty Name: Session:2024 25 (ODD)
Section: All Submission Date:

1. If the Inorder of a binary tree is B,I,D,A,C,G,E,H,F and its post order is I,D,B,G,C H,F,E,A then
draw a corresponding binary tree with neat and clear steps from above assumption.
(BCS-301.3, K3)

2. Insert the following sequence of elements into an AVL tree, starting with empty tree
71,41,91,56,60,30,40,80,50,55 also find the minimum array size to represent this tree.
(BCS-301.3, K2)

3. Write Short notes on Extended Binary Trees (BCS-301.3, K2)

4. What is the difference between a binary search tree (BST) and heap? For a given sequence of
numbers, construct a heap and a BST.
34, 23, 67, 45, 12, 54, 87, 43, 98, 75, 84, 93, 31
(BCS-301.3, K3)
5. What is a B-Tree? Generate a B-Tree of order 4 with the alphabets (letters) arrive in the sequence
as follows:
AGFBKDHMJESIRXCLNTUP
(BCS-301.3, K3)

6. Can you find a unique tree when any two traversals are given? Using the following traversals
construct the corresponding binary tree:
INORDER: H K D B I L E A F C M J G
PREORDER: A B D H K E I L C F G J M.
Also find the Post Order traversal of obtained tree. (BCS-301.3, K3)

7. Consider the following AVL Tree and insert 2, 12, 7 and 10 as new node. Show proper rotation to
maintain the tree as AVL. (BCS-301.3, K3)
8. What maximum difference in heights between the leafs of a AVL tree is possible?
a) log(n) where n is the number of nodes
b) n where n is the number of nodes
c) 0 or 1
d) at most 1
(BCS-301.3, K3)

9. Construct an AVL Trees with the values 1to 10 numbers into an initially empty binary tree.
(BCS-301.3, K3)

10. Differentiate between fixed length and variable length encoding. Draw a Huffman tree for the
following symbols whose frequency of occurrence in a msg is stated along with the symbol below
: A : 15, B : 6, C : 7, D : 12, E : 25, F : 4, G : 6, H : 1, I : 15 Decode the message
1110100010111011 (BCS-301.3, K3)

You might also like