
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
-
Think about when Huffman’s
algorithm does reduce required bit transmission. Use Huffman’s algorithm on the following string: “catsatonhatcathat” (counting the frequencies to make your own frequency histogram). Then try Huffman’s algorithm using trigrams (your stride is 3), start with “cat”, “sat”, “onh”... etc. Use Huffman’s on the following dictionary: cat, sat, on, hat. Calculate and compare the data compression assuming each character in the dictionary is standard 8-bit among the three methods above.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 7 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Consider a list of phone numbers (see the sample below), where each element (phonenumber) in that list is a 12-character long string and the first 3 characters represent an areacode. Write a program that takes a list similar to this and creates a dictionary to store thetotal number of phone numbers for each area. i.e., {area code : total phone numbers for thisarea code}.phonebook = [‘123-456-7890’, ‘234-567-8901’, ‘345-6789-0123’,‘123-000-9999’]Sample output for the phonebook list should be: {‘123’:2, ‘234’:1, ‘345’:1}arrow_forwardBefore adding a new term to a dictionary you should A. Make it a tuple. B. Make it a list C. Make sure the dictionary key doesn’t already exist D. Place it in quotes to make it a string Which one?arrow_forwardWrite a procedure to change one word into another by altering just one letter at a time, given two words of similar length that are in a dictionary. Each new term you learn must already exist in the dictionary.EXAMPLEDAMP, LIKE as inputDAMP->LAMP->LIMP->LIME->LIKE is the output.arrow_forward
- Consider the following program that creates a dictionary counting characters. Complete the code below so that the Python dictionary letters contains the count of each character in the line. Once completed the last line of the program should print 8, the number of spaces in the line. line = "The quick brown fox jumps over the lazy dog" letters = {} for c in line: print (letters [' '])arrow_forwardWrite a function that will accept a dictionary as the input parameter and return a new dictionary where all of the key-value pairs are reversed. For example, if I pass in {"one": 1, "two": 2, "three":3}` I would be returned a dictionary that looked like '{"three": 3, "two":2, "one": 1}arrow_forwardWrite a Python program that takes a String as an input and counts the frequency of each character using a dictionary. For solving this problem, you may use each character as a key and its frequency as values. [You are not allowed to use the count() function] Hint: You can create a new dictionary to store the frequencies. Ignore case for simplicity (i.e. consider P and p to be the same). keys need to be lower case Do not count space. Remove space before counting. example : Sample Input:"Python programming is fun" Sample Output:{'p': 2, 'y': 1, 't': 1, 'h': 1, 'o': 2, 'n': 3, 'r': 2, 'g': 2, 'a': 1, 'm': 2, 'i': 2, 's': 1, 'f': 1, 'u': 1} def task11(in_str): # YOUR CODE HERE return dict_out # please use in_str and dict_outarrow_forward
- There is a string of characters G = g1,g2,g3,...sn with no non-alphabetic characters (i.e no punctuation or spaces). You are also given a function dict(b,i,j), with an input of string b and two indices (i&j). This function will return true if bi...j is a word in the dictionary, and false if not. Please provide a simple dynamic programming solution that can determine if the string F is a sequence of valid dictionary words. State the size of the table, how the table is filled, which elements are filled in first, and where the solution is found. Please find the running time of the algorithm (assume that all calls to the function are O(1)).arrow_forwardHow would you implement a dictionary of a reasonably small size n of you knew that all its elements are distinct (e.g., names of the countries in the world)? Specify an implementation of each dictionary operation.arrow_forwardpython Using try/except block and a for looparrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education