EASY Hashing questions

Use the function hash (KEY, MAXAD) int Hash (char key[12], int maxAddress) { int sum = 0; for (int j=0; j< 12; j += 2) sum=(sum+100*key[j]+key[j+1])%19937;) return sum % maxAddress; } to answer the following questions: a) What is the value of hash ("Jacobs ", 101) ? Letter ASCII code J - 74 a - 97 c - 99 o - 111; b - 98 s - 115 white space - 32 b) It is assumed in the text that the function hash does not need to generate an integer greater than 19937. This could present a problem if we have a file with addresses larger than 19937. Suggest some ways to get around this problem. 2. There is a surprising mathematical result called the birthday paradox that says that if there are more than 23 people in the room, there is a better than 50/50 chance that two of them have the same birthday. How is the birthday paradox illustrative of a major problem associated with hashing? 3. In understanding hashing, it is important to understand the relationship between the size of the available memory and the number of keys to be hashed, the range of possible keys, and the nature of the keys. Let us give names to these quantities, as follows: M = number of available slots (each for one record only); r = number of records; n = number of unique addresses produced by hashing function; K = a key, which can be any combination of exactly five uppercase letters. Suppose h(K) is a hash function that generates addresses between 0 and M-1 a) How many unique keys are possible? (Hint: if K were only one uppercase letter rather then five, there would be 26 possible unique keys; b) How are n and r related? c) How are r and M related? d) If the function h, where a minimum perfect hashing function, how would n, r, and M be related? 4. Suppose that 10 000 addresses are located to hold 8 000 records in a randomly hashed file and the each address can hold one record. Compute the following values: a) The packing density for the file; b) The expected number of addresses with no records assigned to them by the hash function; c) The expected number of addresses with one record assigned (no synonyms); d) Expected number of addresses with one record plus one or more synonyms; e) The expected number of overflow records; f) The expected percentage of overflow records.

## Deliverables

Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. Answers on Microsoft word

## Platform

Must be in Microsoft Word. PLEASE PLEASE restore my faith in Rentacoder! My last coder did not contact or finish the assignemtn until 3 days past the due date. I must have this by my deadline. No exceptions. No deadline = no money.

Habilidades: Programação C, Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Veja mais: would questions, what is r programming, what is functional programming, understanding programming, the five r, range coder, programming questions and answers, programming hash, programming function keys, programming 101, php programming questions, people as letters, o 1 space, money questions and answers, mathematical value of i, int size c, how to get money with programming, hash programming, functional programming in r, five r

Acerca do Empregador:
( 4 comentários ) United States

ID do Projeto: #2848260

Concedido a:


See private message.

$12 USD em 14 dias
(620 Comentários)

5 freelancers estão ofertando em média $12 para esse trabalho


See private message.

$12.75 USD in 14 dias
(72 Comentários)

See private message.

$10.2 USD in 14 dias
(60 Comentários)

See private message.

$12.75 USD in 14 dias
(5 Comentários)

See private message.

$12.75 USD in 14 dias
(1 Comentário)