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

DM Tutorial Assignment 4

The document outlines various assignments related to trees in computer science, including constructing binary search trees, optimal binary prefix codes, and minimum cost spanning trees using Prim's and Kruskal's algorithms. It also includes tasks for drawing binary trees from traversal sequences and calculating the number of nodes in a full binary tree with a specified number of leaves. The assignments cover both theoretical concepts and practical applications of tree data structures.
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)
12 views2 pages

DM Tutorial Assignment 4

The document outlines various assignments related to trees in computer science, including constructing binary search trees, optimal binary prefix codes, and minimum cost spanning trees using Prim's and Kruskal's algorithms. It also includes tasks for drawing binary trees from traversal sequences and calculating the number of nodes in a full binary tree with a specified number of leaves. The assignments cover both theoretical concepts and practical applications of tree data structures.
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

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?

You might also like