Assignment 4: Trees
1. Draw binary search tree for input data
200,100,300,50,150,400,10,75,125,175.
Which is a root, leaf nodes and interior nodes?
2. For given sets of weights construct an optimal binary Prefix code.
4,5,7,8,10,12,20
3. 19 lamps are to be connected to single electrical outlet, using extension Cords , each of which has 4
outlets. Find the number of extension cords needed and draw corresponding tree.
4.Find the minimum cost spanning tree of any graph using Prim’s algorithm.
5 Represent the expression ((x +2) ↑ 3) * (y −(3+x)) − 5 using a binary tree and write its
prefix notation
6. Use Kruskal’s algorithm to find minimum spanning tree (MST) of any given graph.
7. Draw the unique binary tree when inorder and preorder traversal of tree is given.
Inorder sequence: D B E A F C
Preorder sequence: A B D E C F
8. What is total number of nodes in a full binary tree with 20 leaves?