Question

2) Hashing functions can be applied to string of characters. For example "amigo" and "annex" can...

2) Hashing functions can be applied to string of characters. For example "amigo" and "annex" can be assigned hashing value 0, "bike" and "bureaucrat" can be assigned 1, "zebra" can be assigned value 25. So in order to find the hashing value of a word, we find the hashing value of the first letter (ht(a)=0, ht(b)=1, ht(c)=2,….,ht(z)=25). So in this case it is necessary 26 buckets. a) Give an example of another hashing function on string of characters, and determine how many buckets are needed (we can assume that the maximum number of characters in a string is 6).

b) What will be an ideal function so there are not collisions (assuming that the maximum number of characters in a string is 6), and determine the how many buckets are needed

0 0
Add a comment Improve this question Transcribed image text
Answer #1


2 nd one is good question . i really appreciate for that question

Add a comment
Know the answer?
Add Answer to:
2) Hashing functions can be applied to string of characters. For example "amigo" and "annex" can...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Anagram Difference We define an anagram to be a word whose characters can be rearranged to...

    Anagram Difference We define an anagram to be a word whose characters can be rearranged to create another word. Given two strings, we want to know the minimum number of characters in either string that we must modify to make the two strings anagrams. If it's not possible to make the two strings anagrams, we consider this number to be -t For example: tea and ate are anagrams, so we would need to modity 0 characters tea and toe are...

  • Question #2 A DNA molecule can be specified using a string of the characters , ‘g...

    Question #2 A DNA molecule can be specified using a string of the characters , ‘g 'a', 't'. Each of these characters represents one of the four nucleobases Cytosine, Guanine, Adenine, and Thymine. Consult the wikipedia page on DNA for more details. A codon consists of a sequence of three DNA nucle- obases and can be represented by a string of length 3 consisting of characters from the set ‘c', ‘g', ‘a", ‘t'. So "cga" and "ttg" are examples of...

  • Insert elements into a hash table implemented using chain hashing, as an array of linked list...

    Insert elements into a hash table implemented using chain hashing, as an array of linked list in which each entry slot is as a linked list of key/value pairings that have the same hash (outcome value computed using certain hash function). You are allowed to use “Hash Function”, h(k) = k % x where, x is the value you will need to decide to use, that you find appropriate for this implementation. The main requirements are the following: 1. Input:...

  • C programming Problem 3 [Set via Hashing] As mentioned in the lecture, a hash table can...

    C programming Problem 3 [Set via Hashing] As mentioned in the lecture, a hash table can be used to implement a Set ADT. Let's try to use the template below to implement a Set with double hashing. Here we assume the Set contains names with 3 characters long. Since it is a Set, we do not need to have an explicit value for each key. We will use a token value of 1 if a name belongs to the Set....

  • I really need assistance with creating a C++ hash table program for generating a hash from a string. Create a hash funct...

    I really need assistance with creating a C++ hash table program for generating a hash from a string. Create a hash function then test and evaluate the results. The set of strings are from a "words.txt" file (there are 45,402 words in the file, no repeating words. Map the words to 45,402 buckets using a hash function). Requirements: Create an array of 45,402 integers and initialize each to zero. These will be used to store how many times each index...

  • I really need assistance with creating a C++ hash table program for generating a hash from a string. Create a hash funct...

    I really need assistance with creating a C++ hash table program for generating a hash from a string. Create a hash function then test and evaluate the results. The set of strings are from a "words.txt" file (there are 45,402 words in the file, no repeating words. Map the words to 45,402 buckets using a hash function). Requirements: Create an array of 45,402 integers and initialize each to zero. These will be used to store how many times each index...

  • Please complete the following task: Create a C++ hash table program for generating a hash from a string. Create a hash f...

    Please complete the following task: Create a C++ hash table program for generating a hash from a string. Create a hash function then test and evaluate the results. The set of strings are from a "words.txt" file (there are 45,402 words in the file, no repeating words. Map the words to 45,402 buckets using a hash function). Requirements: Create an array of 45,402 integers and initialize each to zero. These will be used to store how many times each index...

  • Objective Learn about String methods Work with the Python documentation Specifics Perform a simple Google search...

    Objective Learn about String methods Work with the Python documentation Specifics Perform a simple Google search (or use any other search engine) on “Python String methods”. One of the first links will be to the Python webpage detailing the built-in data types. This page contains a description of the methods available in String variables. You may use other webpages for this assignment, but you need to be aware of the official documentation for the language. The webpage lists methods that...

  • project-8a Write a function named count_letters that takes as a parameter a string and returns a...

    project-8a Write a function named count_letters that takes as a parameter a string and returns a dictionary that tabulates how many of each letter is in that string. The string can contain characters other than letters, but only the letters should be counted. The string could even be the empty string. Lower-case and upper-case versions of a letter should be part of the same count. The keys of the dictionary should be the upper-case letters. If a letter does not...

  • C programming Let's try to use the template below to implement a Set with double hashing....

    C programming Let's try to use the template below to implement a Set with double hashing. Here we assume the Set contains names with 3 characters long. Since it is a Set, we do not need to have an explicit value for each key. We will use a token value of 1 if a name belongs to the Set. Let's reuse the exact hash functions we have seen in example in Part 7 of the lecture notes, page 3. As...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT