16 Pages

CPSC335_Compression

Course: CPSC 335, Fall 2009
School: Wilfrid Laurier
Rating:
 
 
 
 
 

Word Count: 534

Document Preview

335 CompressionandHuffmanCoding Dr. CPSC Marina Gavrilova Computer Science Unive rs ity o fC a lg a ry C a na d a Lecture Overview Huffman Coding Non-determinism of the algorithm Implementations: Singly-linked List Doubly-linked list Recursive top-down Using heap Adaptive Huffman coding Huffman Coding Algorithm is used to assign a codework to each character in the text according to their...

Register Now

Unformatted Document Excerpt

Coursehero >> Canada >> Wilfrid Laurier >> CPSC 335

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
335 CompressionandHuffmanCoding Dr. CPSC Marina Gavrilova Computer Science Unive rs ity o fC a lg a ry C a na d a Lecture Overview Huffman Coding Non-determinism of the algorithm Implementations: Singly-linked List Doubly-linked list Recursive top-down Using heap Adaptive Huffman coding Huffman Coding Algorithm is used to assign a codework to each character in the text according to their frequencies. The codework is usually represented as a bitstring. Algorithm starts with the set of individual trees, consisting of a single node, sorted in the order of increasing character probabilities. Then two trees with the smallest probabilities are selected and processed so that they become the left and the right sub-tree of the parent node, combining their probabilities. In the end, 0 are assigned to all left branches of the tree, 1 to all right branches, and the codework for all leaves (characters) of the tree is generated. Non-determinism of the Huffman Coding Non-determinism of the Huffman Coding Huffman Algorithm Implementation Linked List Implementation depends on the ways to represent the priority queue, which requires removing two smallest probabilities and inserting the new probability in the proper positions. The first way to implement the priority queue is the singly linked list of references to trees, which resembles the algorithm presented in the previous slides. The tree with the smallest probability is replaced by the newly created tree. From the trees with the same probability, the first trees encountered are chosen. Doubly Linked List All probability nodes are first ordered, the first two trees are always removed. The new tree is inserted at the end of the list in the sorted A order. doubly-linked list of references to trees with immediate access to the beginning and to the end of this list is used. Doubly Linked-List implementation Recursive Implementation Top-down approach for building a tree starting from the highest probability. The root probability is known if lower probabilities, in the roots children, have been determined, the latter are known if the lower probabilities have been computed etc. Thus, the recursive algorithm can be used. Implementation using Heap The min-heap of probabilities is built. The highest probability is put in the root. Next, the heap property is restored The smallest probability is removed and the root probability is set to the sum of two smallest probabilities. The processing is complete when there is only one node in the heap left. Huffman implementation with a heap Huffman Coding for pairs of characters Adaptive Huffman Coding Devised by Robert Gallager and improved by Donald Knuth. Algorithm is based on the sibling property: if each node...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

East Los Angeles College - COMP - 213
COMP 213Advanced Object-oriented ProgrammingLecture 33Generic Methods(Scharf -)Generic MethodsType parameters can also be used locally for generic methods. class GenericMethodTest { static <A> Pair<A,A> duplicate(A a) { return new Pair<A,A
East Los Angeles College - COMP - 213
COMP 213Advanced Object-oriented ProgrammingGeneric MethodsType parameters can also be used locally for generic methods. class GenericMethodTest { Lecture 33Generic Methodsstatic <A> Pair<A,A> duplicate(A a) { return new Pair<A,A>(a,a); } Th
East Los Angeles College - COMP - 213
Java ImplementationCOMP 213Advanced Object-oriented Programmingpublic class Prop { public Prop and(Prop p1, Prop p2) { . } Lecture 14Implementing Prop/ similarly for `or', etc. public String printAllBrackets() { .} public String toString() { .
Wilfrid Laurier - CPSC - 585
Hulk Core Game Design ExcerptsHulk Core Game Design Excerpts.sxw - Page 1 of 24Copyright 2002, 2003, 2004 Radical Entertainment21/01/041 DETAILED GAME-PLAY1.1 FightingWhen Bruce Banner transforms into Hulk, the game-play becomes one of fig
East Los Angeles College - COMP - 213
COMP 213Start and End of ListsAdvanced Object-oriented ProgrammingWe saw that adding to the start of a linked list is straightforward, but that adding to the end of a list required a loop to traverse the list to nd the end. We could improve on t
East Los Angeles College - COMP - 213
COMP 213Client-Server ApplicationsFrom the previous lecture, we know how to open a `client connection' to a remote host, using the java.net.Socket class. (and got some idea of the different levels of protocols involved in sending data from one com
Allan Hancock College - PILACCAR - 200382003
PRIMARY INDUSTRIES LEVIES AND CHARGES COLLECTION AMENDMENT REGULATIONS 2003 (NO. 8) 2003 NO. 222 PRIMARY INDUSTRIES LEVIES AND CHARGES COLLECTION AMENDMENT REGULATIONS 2003 (NO. 8) 2003 NO. 222 - TABLE OF PROVISIONS1. Name of Regulations 2.
Wilfrid Laurier - CPSC - 585
Jackie Chan: Dragon Force[A game proposal]Game Concept . 3 Game Structure.. 3 Gameplay . 4 Jackie Chans Personality: Understanding the Chan Brand.. 5 Jackie Personality The Chan Brand . 6 License, target audience & demographics .. 7 Target Audien
Wilfrid Laurier - CPSC - 585
Technical DesignDocument Number: Date Issued: Filing Path: Document Title: Author: Keywords: Revision HistoryIssue 0.1 Date Nov 26, 2001 Person Lorraine Cobb Reason Initial draft for internal review. 000xx October 29, 2001Document Issue: Document
Rose-Hulman - ECE - 320
ECE-320: Linear Control Systems Homework 2 Due: Tuesday September 13 at 1 PM 1) For systems with the following transfer functions: 1 s+2 s+6 H b (s) = ( s + 2)( s + 3) a) Determine the unit step and unit ramp response for each system using Laplace tr
Wilfrid Laurier - CPSC - 585
Content PipelinesDocument Issue: Date Issued: Document Title: Authors: Keywords: Revision HistoryIssue 0.1 0.2 0.3 Date July 12, 2001 July 20, 2001 July 23, 2001 Person Adam King, Bert Sandie Adam King Adam King Reason - include problem #, ECN #, e
Wilfrid Laurier - CPSC - 585
Technical DesignDate Issued: Document Title: Author: Keywords: Revision HistoryIssue 0.1 0.2 0.3 1.0 Date April 5, 2001 May 5, 2001 June 5, 2001 June 27, 2001 Person Nigel Brooke Nigel Brooke Nigel Brooke Nigel Brooke Reason - include problem #, EC
Wilfrid Laurier - CPSC - 585
A Game Concept By Radical EntertainmentTable of Contents1Game Analysis. 3 1.1Game Concept.. 3 1.2Game Goals.. 3 1.3Game Information. 3 1.4Brand Analysis.. 4 1.5Competitors Analysis.. 4 1.6Story Concept.5 2Game Design.. 7 2.1Expanded Game Concept..
Wilfrid Laurier - CPSC - 585
Pure3D Viewer Quick Reference Camera Controls: Left Mouse Button = Rotate Left + Middle Mouse Buttons = Zoom Middle Mouse Buttons = PanObject Controls: 1-4 = View Objects/Textures/Material/Fonts Right/Left = Prev/Next Object Up/Down =
Allan Hancock College - FCSAIALADA - 2007912
2004-2005-2006-2007The Parliament of theCommonwealth of AustraliaHOUSE OF REPRESENTATIVESPresented and read a first timeFamilies, Community Services andIndigenous Affairs LegislationAmendment (Child Disability Assistance)Bill 2007No
East Los Angeles College - COMP - 523
Lecture 25 Distributed algorithms: Byzantine AgreementCOMP 523: Advanced Algorithmic Techniques Lecturer: Dariusz KowalskiOverviewPrevious lectures: Distributed message-passing model Consensus in synchronized setting Broadcast in asynchronous
East Los Angeles College - COMP - 109
Foundations of Computer Science (COMP109) Exercise 10 1. Explain intuitively the definition of sentences: A formula is a sentence if every occurence of a variable is the scope of either or . Therefore, the truth of a sentence in a model (D, a) does
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Examination 2006-07Suggested solutions Question 1 Solution1A. I. O(n2 ) II. O( n5 ) or O(n5/2 ) III. O( n) IV. O(3n ) 1B. A possible MST: 1 e 2 a 3 b 6 c 7 d5 8 h f g The corresponding order of the edges selected
East Los Angeles College - COMP - 108
COMP108DEPARTMENT : Computer Science Tel. No. 794-3694MAY 2006 EXAMINATIONSBachelor of Arts : Year 1 Bachelor of Science : Year 1 No qualication aimed for: Year 1ALGORITHMIC FOUNDATIONSTIME ALLOWED : TWO hoursINSTRUCTIONS TO CANDIDATESAns
Hudson VCC - BR - 1390
AppendixSoil Testing Lab MethodsSoil samples that come to the lab are assigned a lab number and a subsample is dried overnight at 130 degrees F in a large oven. The soil is then put through a 2 mm sieve to remove coarse fragments. All of the availa
East Los Angeles College - COMP - 108
COMP108DEPARTMENT : Computer Science Tel. No. 794-3694MAY 2005 EXAMINATIONSBachelor of Arts : Year 1 Bachelor of Science : Year 1 Master of Mathematics : Year 2 No qualication aimed for: Year 1ALGORITHMIC FOUNDATIONSTIME ALLOWED : TWO hours
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Examination 2004-05Suggested solutionsQuestion 1 Solution1A. The trace table for m = 5 and n = 3. Before while loop 1st iteration 2nd iteration 3rd iteration i x s 0 1 0 1 5 5 2 25 30 3 125 155The output of the a
East Los Angeles College - COMP - 108
COMP108DEPARTMENT : Computer Science Tel. No. 795-4257MAY 2007 EXAMINATIONSBachelor of Arts : Year 1 Bachelor of Science : Year 1 Bachelor of Science : Year 2 Master of Engineering : Year 1 No qualication aimed for: Year 1ALGORITHMIC FOUNDATI
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 3 (Suggested Solution)8 February 20081. (a) Base case: When n = 0, L.H.S = x0 = 1, R.H.S = (x1 1)/(x 1) = 1 = L.H.S Therefore, statement is true for n = 0 Induction hypothesis: Assume the statement is true
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Class Test 2 (Friday 18 April 2008)Name: ID:Answer ALL questions. Use the space provided and the back page if necessary. 1. Consider the following graph G. The label of an edge is the cost (weight) of the edge. b c
Sveriges lantbruksuniversitet - BISC - 309
Background knowledge expected Population growth models/equations exponential and geometric logistic Refer to 204 or 304 notes Molles Ecology Chs 10 and 11 Krebs Ecology Ch 11 Gotelli - Primer of Ecology (on reserve)The ecology of small populations
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Assessment 1Suggested solutions1. Target: to prove that 2n3 + n3 log n + 3n2 log n + n2 + 3n + 2 log n + 5 is O(n3 log n). 2n3 n3 log n for all n 4, 3n2 log n n3 log n for all n 3, n2 n3 log n for all n 2,
East Los Angeles College - COMP - 108
COMP108 Continuous AssessmentClass Test 1 (avg 62%) 12 Assessment 1 (avg 64%) Test 2 (avg 57%) Assessment 2 (avg 78%)10861148 7 6 5 5 3 0E or below D5 3 15 3 2 3 2 3 35 5 55 4 3 35 4 220CBAA+A+
Sveriges lantbruksuniversitet - BISC - 404
Reproductive and life history strategies Pollination syndromes Breeding systems Plant Gender and Mating systems Timing/frequency of reproduction Seed dispersal and dormancyParts of a FlowerPollination syndromesPollination syndromes Statis
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsDivide and ConquerPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Divide and Conquer Algorithmic FoundationsLearning outcomesCOMP
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108Algorithmic Foundations COMP108Learning outcomes COMP108 Algorithmic FoundationsGraph TheoryAble to tell what is an undirected graph and what is a directed graphKnow how to represent a graph using matrix and lis
McGill - MUMT - 611
Daniel McEnnisMasters Student in Music Technology at McGill UniveristyHomeFeature Extraction SystemA Java Based ApproachPreliminary design documents for version 0.1Class Diagram Use Case Diagram ProjectProposalPast ProjectsMAT proof command
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsGraph TheoryPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Learning outcomesAble to tell what is an undirected graph and what is a di
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 8 (Suggested Solution)14 March 20081. Refer to the program GraphSol.java from the tutorial page. 2. Select a fruit F from the box Orange & Apple. If the fruit F is an apple, then the box should be labelled
Allan Hancock College - PILACCAR - 20064
[pic] Primary Industries Levies and Charges Collection Amendment Regulations 2006 (No. 4)1 Select Legislative Instrument 2006 No. 193 I, PHILIP MICHAEL JEFFERY, Governor-General of the Commonwealth of Australia, acting with t
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsGreedy methods Prudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Greedy methods .Algorithmic Foundations COMP108Learning outcomesUnder
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 4 (Suggested Solution)15 February 20081. Refer to the program SearchSol.java from the tutorial page. 2. Refer to the program MatchSol.java from the tutorial page. 3. Divide the eggs into four groups. Weigh
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 1018 April 2008Note: If youve spent 10 minutes on a question without any clue of how to proceed, talk to the demonstrator. 1. Suppose there are two assembly lines each with 4 stations, Si,j . The assembly t
Sveriges lantbruksuniversitet - IR - 3461
1ENDLEGISLATED POVERTYN E W S L E T T E RJanuary, 1992IIWe won!Single parents on welfare don't have to look for work or training. The new welfare rule goes into effect immediately. End Legislated Poverty worked for three years to get this
Sveriges lantbruksuniversitet - LIB - 3461
1ENDLEGISLATED POVERTYN E W S L E T T E RJanuary, 1992IIWe won!Single parents on welfare don't have to look for work or training. The new welfare rule goes into effect immediately. End Legislated Poverty worked for three years to get this
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsAlgorithm efficiency + Searching/SortingPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Learning outcomesAble to carry out simple asym
Sveriges lantbruksuniversitet - IR - 3471
(TND LEGISLATED#53The B. C. government has changed the welfare law about how much money you can have and still apply for welfare. The new law means that you don't have to use up nearly all your savings before you can apply for welfare. If you are a
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 7 (Suggested Solution)7 March 20081. Iterative method: T (n) = = = = = = = = = = = = 3 T (n 1) + 1 3 (3 T (n 2) + 1) + 1 32 T (n 2) + 3 + 1 32 (3 T (n 3) + 1) + 32 + 3 + 1 33 T (n 3) + 32 + 3 + 1 33 (3,
Sveriges lantbruksuniversitet - IR - 2605
Evidence Based Library and Information Practice 2006, 1:2 Evidence Based Library and Information Practice Commentary Evidence Based Librarianship and Open Access Heather Morrison Project Coordinator, British Columbia Electronic Libr
Sveriges lantbruksuniversitet - LIB - 2605
Evidence Based Library and Information Practice 2006, 1:2 Evidence Based Library and Information Practice Commentary Evidence Based Librarianship and Open Access Heather Morrison Project Coordinator, British Columbia Electronic Libr
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 77 March 2008Note: If you've spent 10 minutes on a question without any clue of how to proceed, talk to the demonstrator. 1. Solve the following recurrence by the iterative method. T (n) = 1 3 T (n - 1) + 1
Sveriges lantbruksuniversitet - IR - 2059
EVIDENCE ON THE BANK LENDING CHANNEL IN UKRAINEInna Golodniuk University Degree in Physics, Chernivtsi National University, 1997 MA in Economics, University of Kyiv-Mohyla Academy, 1999PROJECT SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS
Sveriges lantbruksuniversitet - LIB - 2059
EVIDENCE ON THE BANK LENDING CHANNEL IN UKRAINEInna Golodniuk University Degree in Physics, Chernivtsi National University, 1997 MA in Economics, University of Kyiv-Mohyla Academy, 1999PROJECT SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 629 February 20081. Merge sort is a sorting algorithm that divides n numbers into two halves, recursively sorts each of them, and then merge the two resulting sorted lists into a final sorted list. Apply mer
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Assessment 1Deadline: Friday, 7 March 2008 (4pm)(Submit to Student One-Stop-Shop) 1. Prove that the function 2n3 +n3 log n+3n2 log n+n2 +3n+2 log n+5 is O(n3 log n). Remember to explain for each term why it is no mor
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsIntroduction + Mathematical InductionPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108/200708Algorithmic Foundations COMP108Module information Algorithmic Foundation
East Los Angeles College - COMP - 108
COMP108 Algorithmic Foundations Tutorial 125 January 20081. Simplify the following mathematical expressions (a) (x - 2)(x + 1) + x + 2 (b) x2 + 2x + 1 (d) 2 + log2 (x/4) 2. Give the trace table and the output of the following algorithm for m = 16.
Sveriges lantbruksuniversitet - IR - 1590
Playful Play with Games: Linking Level Editing to Learning in Art and DesignMaia EngeliPlanetary Collegium University of Plymouth UK maia@enge.li ABSTRACT The title Playful Play with Games refers to the possibility of creative involvement with game
East Los Angeles College - COMP - 108
AlgorithmicFoundations COMP108COMP108 AlgorithmicFoundationsDivideandConquerPrude Wong ncehttp:/www.csc.liv.ac.uk/~pwong/te aching/com p108AlgorithmicFoundations COMP108DivideandConquerAlgorithmicFoundationsLearningoutcomesCOMP108 U
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsAlgorithm efficiency + Searching/SortingPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Learning outcomes Ableto carry outAlgorithmic Foundations COMP108sim asympt
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsIntroduction + Mathematical InductionPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108/200708Algorithmic Foundations COMP108Module information .Teaching TeamDr Prud
East Los Angeles College - COMP - 108
AlgorithmicFoundations COMP108COMP108 AlgorithmicFoundationsGraphTheoryPrude Wong ncehttp:/www.csc.liv.ac.uk/~pwong/te aching/com p108Learningoutcomes Ableto te llAlgorithmicFoundations COMP108what is an undire d graph and what is a cte
East Los Angeles College - COMP - 108
Algorithmic Foundations COMP108COMP108 Algorithmic FoundationsDynamic ProgrammingPrudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108Algorithmic Foundations COMP108Dynamic programmingan efficient way to implement some divide and
Sveriges lantbruksuniversitet - ECON - 305
Problem Set #5 Answer KeyEconomics 305: Macroeconomic Theory Spring 20071Chapter 9, Problem #1There are two eects of an increase in the depreciation rate. First, given the marginal product of capital in period two, M PK , the net marginal prod
East Los Angeles College - COMP - 108
AlgorithmicFoundations COMP108COMP108 AlgorithmicFoundationsGreedymethods Prudence Wonghttp:/www.csc.liv.ac.uk/~pwong/teaching/comp108AlgorithmicFoundations COMP108GreedymethodsLearningoutcomes Unde rstand whatAlgorithmicFoundations COMP
Sveriges lantbruksuniversitet - ECON - 305
Econ 305 Spring 2008 Tutorial Notes 2Chapter 3 3. Correlation a) Positive. b) Negative. c) Negative. d) Positive. e) Politicians would certainly argue that the correlation is positive. Others may be less sure. f) 4. Leads and Lags. a) The cleanlines