Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this task we will get first experience with Linear Hashing. We want to store a sequence of elements into a hash-structure and afterwards delete

In this task we will get first experience with Linear Hashing. We want to store a sequence of elements into a hash-structure and afterwards delete some of the entries. Before you start, you have to add another index at the end of the list. Convert your own birthday into an index, by building the checksum between day, month and year, where you add the day, the month and the checksum of the year like it is shown in the 3 examples below:

f(27.01.2021) := 27 + 01 + 2 + 0 + 2 + 1 = 33 f(01.10.1995) := 01 + 10 + 1 + 9 + 9 + 5 = 35 f(31.12.2000) := 31 + 12 + 2 + 0 + 0 + 0 = 45 Afterwards add the new created index to the end of the following sequence: 22, 8, 17, 55, 65, 78, 23, 30, 1

Hint: If the index of your birthday is the same as an already existing value in the sequence, you can add 1 until you get a new value!

(a) Explain why using the scheme described in task 1 could lead to errors, when calculating the index value for different birthdays!

(b) Start with M = 2 and level = 0 and use the hash function h0(k) = k% M, to insert the sequence into a linear hash structure: Show the hash structure after each insertion!

(c) Delete the following sequence of indexes from your hash structure: , 17, 22, 30 Show the hash structure after each deletion!

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

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions