What are the three hashing techniques use in open addressing

Assignment Help Computer Engineering
Reference no: EM133477493

Assignment: Multiplication Factor and Technique of Collision Resolution

Objective: Objective of the homework is to reinforce the concepts related to one of the most important data structures: hash table.

Part A

I. Assume that a hash table has 11 slots and the hash function is h(k) = k mod 11. Demonstrate the insertion into the hash table of the following sequence of keys with collision resolved by chaining: 5, 28, 19, 15, 20, 33, 12, 17, 10, 13

II. Consider a hash table of size m=1000 and a corresponding hash function h(k) given by the multiplication method for A ? (?5 - 1)/2 = 0.6180... (as discussed in the lecture slides). Compute the locations to which the following sequence of keys are mapped: 61, 62, 63, 64, 65.

III. Open addressing is another technique of collision resolution.

1. What are the three hashing techniques used in open addressing?

2. Which of the above techniques can generate primary clustering? Explain how primary clustering can be formed using an example. Why primary clustering is not desirable?

3. Which of the above techniques can generate secondary clustering? Explain how secondary clustering can be formed using an example.

4. Which of the above techniques can eliminate both primary clustering and secondary clustering? Explain using an example.

Part B: Programming Problem

Suppose you are implementing a dynamic set of bank account records as a hash table for the Sun Devil Bank. Each bank record has an account number, owner's name and the current balance. the account number is any six-digit integer number between 100001 and 999999. No two records can have the same account number. In addition to the key, each record has following information.
Even though the account number can take a value between 100001 and 999999. Even though the account number gives a higher range of numbers bank will not have more than 800 accounts at a given time.

Hash Table Implementation Details: You will implement this hash table in two ways as described below. You need to design a suitable node structure for account record and then each slot on in the hash table can be a pointer to an account record

I. Hashing chaining in case of collision. Hash function h(k) = k mod m

Assume that the hash key is k mod m and using chaining in case of a collision. The size (m) of the hash table (T) is 753. Also, you can assume that account numbers are generated using a random uniform distribution function and each account number is unique.

Write a C or C++ program that Implements the hash table construction for the above scenario and then implement the following three functions

1. INSERT_Account(T, x) // insert the bank account record x to the table

2. DELETE_Account(T, k) // delete the bank account record from the table where k is the account number

3. SEARCH_Account(T, k) //search the account number k in the hash table and returns the corresponding bank account record and display account information

For the insert operation, read the owner's name, account number and the account balance from the keyboard. For delete and search operations, read the account number from the keyboard

II. Hashing open addressing in case of collision. Use linear probing

h(k, i) = (h'(k) + i) mod m. i = 0, 1, 2, ..., and h'(k) = k mod m

The size (m) of the hash table (T) is 753. Also, you can assume that account numbers are generated using a random uniform distribution function and each account number is unique.

Write a C or C++ program that Implements the hash table construction for the above scenario and then implement the following three functions

INSERT_Account(T, x) // insert the bank account record x to the table SEARCH_Account(T, k) //search the account number k in the hash table and returns the corresponding bank account record and display account information.

For the insert operation, read the owner's name, account number and the account balance from the keyboard. For the search operations, read the account number from the keyboard

Reference no: EM133477493

Questions Cloud

Discuss why you think the fair value approach best values : Discuss why you think the fair value approach best values the long-term assets on the balance sheet. In addition, provide an example to support your position.
Communication is critical aspect of all organizations : Communication is a critical aspect of all organizations. It's how we coordinate actions and achieve goals.
Discuss potential strategies that could be used to reduce : Discuss potential strategies that could be used to reduce the demand for energy in industrialized economies with large populations.
What barriers to effective communication : What barriers to effective communication would you anticipate from external and internal stakeholders group?
What are the three hashing techniques use in open addressing : What are the three hashing techniques used in open addressing? Which of the above techniques can generate primary clustering?
How is each type of rna important to protein production : Describe how genetic information flows between those types of molecules. Include the results of the processes of transcription and translation
How is glygogen different from starch : Glucose (sugar) can be produced naturally by our liver, stomach, and muscles. Both plant starch and gycogen are made of chains of glucose.
Important issue for environmental sustainability : Biodiversity should be considered an important issue for environmental sustainability.
Compare green party and republican party positions : Compare green party and Republican Party positions on climate change. Do they think climate change is caused by human activity

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd