Question

consider the following setup for a hashmap. this hashmap will represent a very large number of...

consider the following setup for a hashmap. this hashmap will represent a very large number of people in the world. the bash-ing function will work as follows. it will represent the days of the week (sunday-saturday) as numbers, 0-6, 0 is sunday, 1 is monday, etc. for each person, it will assign them to the number that corresponds to the day they were born. For example, if I was born on a sunday, I would be hashed to equal the number 0. Explain why this hashing algorithm is suboptimal, mainly for lookup

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

Basically, Hashing is used to index and retrieve items in a database because it is faster to find the item using the shorter hashed key than to find it using the original value.

Here, in the question all people are catergorised in just 7 numbers. We will not be able to specifically find who born on let's say Sunday as there will be too many people. Hashing is only good with there is a unique hash for every input but here in the given case we would get same hash for many different inputs .

Hence, hashing will suboptimal.

Add a comment
Know the answer?
Add Answer to:
consider the following setup for a hashmap. this hashmap will represent a very large number of...
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
  • I have counted the number of statistics problems I do every day. The following data lists...

    I have counted the number of statistics problems I do every day. The following data lists the day of the week and how many problems I did on that day in the second column. The third column gives the percent of problems theory suggests I should have done. Sunday 25 0 Monday 102 20 Tuesday 87 10 Wednesday 122 20 Thursday 76 10 Friday 111 20 Saturday 50 20 Test if I followed the theory at α=10%

  • I need to create a Java class file and a client file that does the following:  Ask user to enter Today’s date in the fo...

    I need to create a Java class file and a client file that does the following:  Ask user to enter Today’s date in the form (month day year): 2 28 2018  Ask user to enter Birthday in the form (month day year): 11 30 1990  Output the following: The date they were born in the form (year/month/day). The day of the week they were born (Sunday – Saturday). The number of days between their birthday and today’s...

  • C Programming Quesition (Structs in C): Write a C program that prompts the user for a...

    C Programming Quesition (Structs in C): Write a C program that prompts the user for a date (mm/dd/yyyy). The program should then take that date and use the formula on page 190 (see problem 2 in the textbook) to convert the date entered into a very large number representing a particular date. Here is the formula from Problem 2 in the textbook: A formula can be used to calculate the number of days between two dates. This is affected by...

  • I need help with a project, I’ve seen many answers in C++, but i need it to be in swift, thank you!

    I need help with a project, I’ve seen many answers in C++, but i need it to be in swift, thank you! Write a program that asks the user to enter a date (e.g. July 4, 2008) and will return the day of the week that corresponds to that date. Your program should take the input in numeric form, thus the input prompt should be as follows: Please enter a date below: Enter month (1-12): Enter day (1-31) Enter year...

  • Please help in Intro to C coding class it is C language Since Arup enjoys many...

    Please help in Intro to C coding class it is C language Since Arup enjoys many different activities, he often overbooks himself. In the past, this wasn’t a problem. Either he would simply go to parts of two events that coincided, or he’d simply call the person hosting one of the two events telling them he couldn’t make it. Normally, this didn’t cause a problem because none of his appointments were ones that he absolutely had to keep. But now...

  • Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b):...

    Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b): Write a program that gives remainder without using modulus operator and loops. The first number entered will be dividend and second number entered will be divisor. Sample input: 15 6 Sample output: Remainder is 3 In a right triangle, the square of the length of one side is equal to the sum of the squares of the length of the other two sides. Write...

  • This lab will create a digital clock based on nested FOR loops for hours, minutes, and...

    This lab will create a digital clock based on nested FOR loops for hours, minutes, and seconds, and a WHILE loop for doing over and over so that your clock works for all year long without interruption. Note: If a group of students is interested, we could create a real digital wall-mounted clock to be placed in our classroom, so I can keep track of the time during my lectures. The actual clock would be based on the LED Strip...

  • Many of us have large digital music collections that are not always very well organized. It...

    Many of us have large digital music collections that are not always very well organized. It would be nice to have a program that would manipulate our music collection based on attributes such as artist, album title, song title, genre, song length, number times played, and rating. For this assignment you will write a basic digital music manager (DMM). Your DMM program must have a text-based interface which allows the user to select from a main menu of options including:...

  • In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to...

    In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to design how to do it. Problem description You are given a text file called 'Students.txt' that contains information on many students. Your program reads the file, creating many Student objects, all of which will be stored into an array list of Student objects, in the Students...

  • In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list...

    In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to design how to do it. Problem description You are given a text file called 'Students.txt' that contains information on many students. Your program reads the file, creating many Student objects, all of which will be stored into an array list of Student objects, in the Students...

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