4. Consider the following person database and hash function: Table 3: Person Database Name Ross }...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. Consider the following person database and hash function: Table 3: Person Database Name Ross } Chandler Monica Age 32 int hash_function(person P) { 36 30 string name P. name; int age P.age; int sex P.sex; int mod = 18; int hash name.size(); } return hash % mod; Sex Male Male Female if(sex == "Female") hash++; for (int i = 0; i < name.size(); i++){ int ascii_val = (int)name[i]; hash + ascii_val - 97; Figure 1: Hash function a) Calculate the hash values using the given hash function for all the entries in the person database. b) Create two additional non duplicate entries in the database with age less than 40, for which the calculated hash value using the given hash function will collide with at least one of the existing entries' hash values. c) With proper justification, propose two modifications in the given hash function that will lessen the probability of collision between multiple entries. 5 (CO1) (POI) 10 (CO4) (PO3) 10 (C04) (PO3) 4. Consider the following person database and hash function: Table 3: Person Database Name Ross } Chandler Monica Age 32 int hash_function(person P) { 36 30 string name P. name; int age P.age; int sex P.sex; int mod = 18; int hash name.size(); } return hash % mod; Sex Male Male Female if(sex == "Female") hash++; for (int i = 0; i < name.size(); i++){ int ascii_val = (int)name[i]; hash + ascii_val - 97; Figure 1: Hash function a) Calculate the hash values using the given hash function for all the entries in the person database. b) Create two additional non duplicate entries in the database with age less than 40, for which the calculated hash value using the given hash function will collide with at least one of the existing entries' hash values. c) With proper justification, propose two modifications in the given hash function that will lessen the probability of collision between multiple entries. 5 (CO1) (POI) 10 (CO4) (PO3) 10 (C04) (PO3)
Expert Answer:
Answer rating: 100% (QA)
Step 1 Lets go through the explanation step by step Step 1 Calculate Hash Values for Existing Entries Explanation For each existing entry in the person database we apply the provided hash function to ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
A small company that provides customer assistance with computer software has the following group of employees. Using the information in this table, calculate the following probabilities. a. One...
-
A cross-sectional study was carried out to assess the relationship of alcohol and smoking to blood pressure in 2,500 men ages 20 years or older in four North American population groups, each group...
-
Given: MIII; Prove: M Use the definitions and postulates given in Example 2 to prove the theorems in Problems 914. Give both statements and reasons.
-
Kobayashi Group manufactures a check-in kiosk with an estimated economic life of 12 years and leases it to Japan Airlines (JAL) (JPN) for a period of 10 years. The normal selling price of the...
-
How does virtue theory apply to both the decision maker and the act under consideration by that party? Explain.
-
Section2.1 described a sample of \(n=50\) geographic areas (Zip codes) containing sales data on the Wisconsin state lottery ( \(y=\) SALES). In that section, sales were analyzed using a basic linear...
-
Once a company allocates corporate costs to divisions these costs should not be reallocated to the indirect-cost-pools of the division. Do you agree? Explain.
-
You purchase 100 shares of stock for $50 a share. The stock pays a $4 per share dividend at year-end. a. What is the rate of return on your Investment If the end-of-year stock price Is (1) $46; (II)...
-
ARROWBELL COMPANY Statement of Cash Flows For Years Ended December 31, 2011 and 2010 Cash flows from operating activities: Net income Noncash expenses, revenues, losses, and gains included in income:...
-
What is stagflation? Why might a supply shock result in it?
-
Suppose that you are the owner of a professional baseball team in a major city, and MLB allows a second team to locate in your city. Describe and show using a graph the potential impact on your...
-
Select indicators from Table 10-3 that would be useful for the titrations in Figures 10-1 and 10-2 and the pK a = 8 curve in Figure 10-3. Select a different indicator for each titration and state...
-
William Blake runs a local taxi service. Lately his phone has been flooded with customer complaints. He gives you the following list of complaints. REQUIRED: a. Draw a Pareto chart of these problems....
-
Find the position of the first minimum for a single slit of width 0.04 \(\mathrm{mm}\) on a screen of \(2 \mathrm{~m}\) distance, when light from a He-Ne laser \(\lambda=\) 6328 is shone on the slit.
-
A shed with a cost of $10,000 and accumulated depreciation of $7,500 was torn down. Prepare the journal entry to record the disposal of this asset. How much will the credit side of this entry be in...
-
a) Calculate the goodwill that was paid by Major Ltd on the acquisition of Minor Ltd. [10 marks] b) Prepare the consolidated statement of financial position for Major Ltd at 31 July 20X8. [30 marks]...
-
Jerry made the following contributions during 2012: His synagogue (by check).....................................................$680 The Democratic Party (by check)...
-
Your supervisor has asked you to research the following situation concerning Owen and Lisa Cordoncillo. Owen and Lisa are brother and sister. In May 2012, Owen and Lisa exchange business pickup...
-
Patty Bayan is a single taxpayer living at 543 Space Drive, Houston, TX 77099. Her Social Security number is 466-33-1234. For 2012, Patty has no dependents, and her W-2 from her job at a local...
-
Sketch and explain a simple diagram to match your exhibit.
-
a. Write out and explain the equation for volume breakeven. b. What is the difference between accounting breakeven and economic breakeven?
-
a. What is profit analysis, also known as cost-volume-profit (CVP) analysis? b. Why is profit analysis so useful to healthcare managers? c. What is a profit and loss (P&L) statement?
Study smarter with the SolutionInn App