ps4 - Department of Electrical and Computer Engineering...

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

Department of Electrical and Computer Engineering McGill University ECSE-322 Computer Engineering Fall 2010 Problem Set 4 1. Hashing: We need to use a hashing function in order to store, in an array of strings, family names of the 10 top students of a class of 1000 students. We have the following family of hashing functions: H k (e) = ((e)ModM+k)Mod M, where k is the hashing function number, and M is the number of positions in the array. (a) Give some examples of what we can use as the key: e . (b) What size array should we dedicate for storage? (c) Describe when hashing is best suited to store data (in general). Is it well suited for this problem? (d) Explain why the 1 st Mod function is useful? The 2 nd ? (e) How would you go about retrieving such data? (f) What problem with hashing does bucket hashing help solve? (g) Show the array of hashed elements for the following names using e=(sum(ASCII(1 st letter of name)+ ASCII(last letter of name))): Names: Daniels, Arnold, Beaudet, Stephens, Durocher, Atkins, Moore, Cameron, Ini, Lanf (i) Using the family of hashing function described (ii) Using bucket hashing 2. Design a data structure for representing signed integer numbers of arbitrary size, with

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.

This note was uploaded on 11/22/2010 for the course ECSE ECSE 322 taught by Professor Lowther during the Winter '04 term at McGill.

Page1 / 3

ps4 - Department of Electrical and Computer Engineering...

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

View Full Document
Ask a homework question - tutors are online