Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( c ) A hash table of size in contains two fields - an integer data field and an integer link field ( called data

(c) A hash table of size in contains two fields-an integer data field and an integer link field (called data and next, say). The next field is used to link data items in ascending order. A value of -1 indicates the end of the list. The variable top (initially set to -1) indicates the location of the smallest data item.
Integers are inserted in the hash table using "open addressing with double hashing". Assume that the function h1 produces the initial hash location and h2 produces the increment. An available location has the value Empty and no item is ever deleted from the table.
Write programming code to search for a given value key. If found, do nothing. If not found, insert key in the table and link it in its ordered position. You may assume that the table contains room for a new integer.
[8 marks]
[Total marks: 19]
image text in transcribed

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions