Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Algorithms: Union-Find, Huffman Coding and Minimum Spanning Tree, Assignments of Algorithms and Programming

Problem sets from a fall 2008 computer science course focusing on algorithms. The problems involve union-find data structure, huffman coding, and minimum spanning tree. Students are asked to analyze union-find forest with and without path compression, build huffman coding tree, prove properties of huffman codes, find minimum required register width for huffman codes, and show that t โˆฉ h is contained in some mst of h.

Typology: Assignments

Pre 2010

Uploaded on 03/10/2009

koofers-user-bf4
koofers-user-bf4 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download Algorithms: Union-Find, Huffman Coding and Minimum Spanning Tree and more Assignments Algorithms and Programming in PDF only on Docsity! Head-Banging Session 5 Fall 2008 CS 473: Algorithms Problem 1. [Saving with Union-Find] Show the Union-Find forest that results from the following sequence of operations on the ten singleton elements a, b, . . . , j. Do this exercise two ways: with and without path compression. On which steps does path compression save running time? UNION(FIND(a), FIND(e)) UNION(FIND(c), FIND(b)) UNION(FIND(b), FIND(h)) FIND(e) UNION(FIND(f), FIND(e)) UNION(FIND(j), FIND(g)) UNION(FIND(g), FIND(b)) UNION(FIND(i), FIND(c)) FIND(j) UNION(FIND(e), FIND(d)) UNION(FIND(a), FIND(c)) FIND(g) Problem 2. [Practice With Huffman] The following table contains Huffman code for the given nine-letter alphabet. Letter โ€” Code Word O โ€” 1111100 D โ€” 1111101 M โ€” 11110 R โ€” 11101 S โ€” 11100 A โ€” 100 I โ€” 110 T โ€” 101 E โ€” 0 Build the Huffman coding tree that corresponds to the above code. Is the given encoding an optimal encoding? If not, how could you improve it? What are possible frequencies for the letters in this alphabet that would result in the optimal tree that you have drawn? 1
Docsity logo



Copyright ยฉ 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved