l10-heaps

l10-heaps - CS112: Data Structures Lecture 10 Heaps CS112:...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CS112: Slides for Prof. Steinberg ʼ s lecture 1 Lecture 10 CS112: Data Structures CS112: Data Structures Lecture 10 Heaps
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS112: Slides for Prof. Steinberg ʼ s lecture 2 Lecture 10 Review: General Trees Review: General Trees Each node has an arbitrary number of children Problem: representation of a node B C D A H E F G I J
Background image of page 2
CS112: Slides for Prof. Steinberg ʼ s lecture 3 Lecture 10 General Trees General Trees Each node has an arbitrary number of children Problem: representation Solution: linked list of children B C D A H E F G I J first child next sibling
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS112: Slides for Prof. Steinberg ʼ s lecture 4 Lecture 10 General Tree as Binary General Tree as Binary First child <=> Left child Next sib <=> Right child B C D A H E F G I J
Background image of page 4
CS112: Slides for Prof. Steinberg ʼ s lecture 5 Lecture 10 Data Compression Data Compression In most data some symbols appear more often than others Eg English text ‘e’ appears more often than ‘q’ In ascii code, each character is 8 bits. Suppose we had a code in which common symbols took fewer bits and uncommon symbols took more bits
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS112: Slides for Prof. Steinberg ʼ s lecture 6 Lecture 10 Huffman Code Huffman Code EG 3 symbols: a, b, c, with a most frequent Code: 0 = a, 10 = b, 11 = c
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/01/2011 for the course 198 112 at Rutgers.

Page1 / 22

l10-heaps - CS112: Data Structures Lecture 10 Heaps CS112:...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online