{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ECE165_2008FALL_EXAM2__[0]

# ECE165_2008FALL_EXAM2__[0] - Data Structures and Algorithms...

This preview shows pages 1–4. Sign up to view the full content.

Data Structures and Algorithms II Fall 2008 Final Exam Name: Email: Write all of your answers directly in the test booklet. Use the backs of pages if necessary. Feel free to use scrap paper, but do not hand it in. Please also write your name on the top of each page.

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

View Full Document
(25 points) (1) I looked up the term "abracadabra" on Wikipedia; here is what I learned about the history of the word (copied from Wikipedia): "The word is now commonly used as an incantation by stage magicians. In ancient times, however, it was taken much more seriously as an incantation to be used as a cure for fevers and inflammations. The first known mention was in the 2nd century A.D. in a poem called De Medicina Praecepta by Serenus Sammonicus, physician to the Roman emperor Caracalla, who prescribed that the sufferer from the disease wear an amulet containing the word written in the form of an inverted cone: A B R A C A D A B R A A B R A C A D A B R A B R A C A D A B A B R A C A D A A B R A C A D A B R A C A A B R A C A B R A A B R A B A This, he explained, diminishes the hold of the spirit of the disease over the patient. Other Roman emperors, including Geta and Alexander Severus, were followers of the medical teachings of Serenus Sammonicus and are likely to have used the incantation as well." I copied that inverted cone to a text file named "ABRACADRABRA.txt". The cone appears centered here, and in Wikipedia, but not in the text file, which looks like this: A B R A C A D A B R A A B R A C A D A B R A B R A C A D A B A B R A C A D A A B R A C A D A B R A C A A B R A C A B R A A B R A B A
I saved this as a Unix-style text file, so there is a single newline character at the end of each line. This text file thus contains 132 total characters including 7 distinct types of characters - namely 'A', 'B', 'C', 'D', 'R', space, and newline characters - with the following frequencies: Character Count A 30 B 13 C 7 D 5 R 11 space 55 newline 11 Imagine applying Huffman coding to compress this text file. Assume that you will

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

ECE165_2008FALL_EXAM2__[0] - Data Structures and Algorithms...

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

View Full Document
Ask a homework question - tutors are online