Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Canadian postal codes are of the form ' L1D1L2D2L3D3 ', where ' L ' is always a letter (A-Z) and ' D ' is

image text in transcribed
a) Canadian postal codes are of the form ' L1D1L2D2L3D3 ', where ' L ' is always a letter (A-Z) and ' D ' is always a digit (0-9). Suppose you have a company and you wish to keep track of customers who have similar postal codes, so the map might be (postal code, list of customers). Let the letters A-Z be coded with numbers 1 to 26 , for example code(B)=2, and let the digits be coded by their numerical values. i. For a hash function: hash(L1D1L2D2L3D3)=(i=13code(Li)+i=13code(Di))mod10 ii. Give an example of a postal code that begins with H3A and collides with H2B5X7. Give an example of a hash function that would never result in a collision. How large would the hash table need to be? b) Both hashing and binary search trees allow to efficiently store and access map entries. What are the advantages/disadvantages of each, which would make you choose one over another

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

1. Identify three approaches to culture.

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago