Exercise 1Consider a hash table of size 13, and assume open addressing with linear probing Show what the hash table will look like after the following items are added in the order shown.26 54 77 90 27 30 28 52 96 65  What’s the load factor of the hash table after the values above are added?   If any of the values cause a collision, indicate which.   How many comparisons are needed to find 65 in the table? Briefly explain.   How many comparisons are needed to determine that 104 is not in the table? Briefly explain.   What’s the hash value computed for the string “dog”? Show your work.    Exercise 2Suppose chaining is used as the method for collision resolution.Part AShow what the hash table will look like after the following items are added in the order shown.26 54 77 90 27 30 28 52 96 65       How many comparisons are needed to find 65 in the table?    How many comparisons are needed to determine that 104 is not in the table? Briefly explain.    Exercise 3Consider a hash table with a load factor of 0.8. What’s the average number of comparisons for a successful search assuming open addressing with linearprobing?  What’s the average number of comparisons for a unsuccessful searchgiven the same assumptions?

Question
Asked Nov 12, 2019
168 views

Exercise 1

Consider a hash table of size 13, and assume open addressing with linear probing

 

  1. Show what the hash table will look like after the following items are added in the order shown.

26 54 77 90 27 30 28 52 96 65

 

 

  1. What’s the load factor of the hash table after the values above are added?

 

 

 

  1. If any of the values cause a collision, indicate which.

 

 

 

  1. How many comparisons are needed to find 65 in the table? Briefly explain.

 

 

 

  1. How many comparisons are needed to determine that 104 is not in the table? Briefly explain.

 

 

 

  1. What’s the hash value computed for the string “dog”? Show your work.

 

 

 

 

Exercise 2

Suppose chaining is used as the method for collision resolution.

Part A

  1. Show what the hash table will look like after the following items are added in the order shown.

26 54 77 90 27 30 28 52 96 65

 

 

 

 

 

 

 

  1. How many comparisons are needed to find 65 in the table?

 

 

 

 

  1. How many comparisons are needed to determine that 104 is not in the table? Briefly explain.

 

 

 

 

Exercise 3

  1. Consider a hash table with a load factor of 0.8. What’s the average number of comparisons for a successful search assuming open addressing with linear

probing?

 

 

  1. What’s the average number of comparisons for a unsuccessful search

given the same assumptions?

 

check_circle

Expert Answer

Step 1
  1.  
  • As the given size of the table is 13, as well as the number of elements to be inserted in the table is 10 (26, 54, 77, 90, 27, 30, 28, 52, 96, 65).
  • Insert element in hash table by using formula <element> MOD <size of hash table> (it returns remainder as a result).
  • And on the basis of the result from the above formula for every element, the element will be stored accordingly.
help_outline

Image Transcriptionclose

26 0 90 1 54 2 30 4 28 5 52 6 96 7 65 8 9 10 11 77 12 N LO CO 27

fullscreen
Step 2

2. 

  • The load factor of the above table will be calculated, which tells the number of collisions probability.
  • The load factor of a specific hash table directly proportional to element collision in the hash table. And the formula is:

Load factor = <n...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Coding Theory

Related Computer Science Q&A

Find answers to questions asked by student like you
question_answer

Q: 2. What are the differences between the top-down and bottom-up approaches to information security?Wh...

A: What are the differences between the top-down and bottom-up approaches to information security?Why i...

question_answer

Q: Python 3.7.4 Write the code to call a function whose name is send_number. There is one argument for ...

A: Source Codedef send_number(n):    #getting the value 5 from the function call.  print("The value of ...

question_answer

Q: Write a C program that converts an uppercase character to alowercase character. Declare functionchar...

A:  To solve this question following variables and function should be required:Variables: ch, char and ...

question_answer

Q: Write a program that takes the x, y coordinates of a point in the Cartesian plane and prints amessag...

A: Note: You didn't mention any languages so i use C language//include the header file#include&lt;stdio...

question_answer

Q: Write a program that reads integers from a file, sums the values and calculates the average. Write...

A: The below given C++ program will obey the following rubrics:Importing essential header files.Definin...

question_answer

Q: Given the follwing business rules, create an ERD.  The ERD must include all primary keys, foreign ke...

A: The entities, primary keys and foreign keys and attributes of ERD are:

question_answer

Q: I have written a C++ class called 'Birthday' and I want to write a method that can compare with anot...

A: Programming instructions:First, create the constructor to initialize the variables with the initial ...

question_answer

Q: PLEASE EXPLAIN ALL STEPS  In the following code, determine the values of the symbols this, that, and...

A: Before explaining the difference first user must know about the Assembly language.Assembly language:...

question_answer

Q: Write a program that displays the income tax due on taxable income entered by the user. Have the use...

A: The program that displays the income tax due on taxable income is created in java.In calTax() method...

question_answer

Q: I have this project where I create a program that calculates the area of a rectangular prism. I am s...

A: Create a JAVA class Prismarea which contains a method calcArea() and instance variable “a” to store ...

question_answer

Q: Write a python program and solve the problem. Selling a new vehicle pays a salesperson $1800. Sellin...

A: Program Instructions:Prompt the user to enter type and selling price of 2 vehicles. One must be old ...

question_answer

Q: Suppose you want to build a program using WebGL that draws two kinds of objects - shiny billiard bal...

A: Drawing multiple objects in WebGLIn order to draw two kinds of objects in WebGL, first call function...

question_answer

Q: WRITE A SHORT NOTE ON THE PRIMITIVE COMPONENTS OF BITCOIN VALUE CHAIN?

A: Bitcoin Value Chain can be defined with the help of three terms BlockChain, Private Keys and third M...

question_answer

Q: How does data mining impact personal privacy and security?

A: Data mining:Data mining is a process to explore and analyze new, unsuspected, previously unknown and...

question_answer

Q: In MS Access, which kind of values will be accepted by the databasethrough input mask&gt;L0L0L0;0;#A...

A: An input mask in MS-Access contain 3 fields.These fields are separated by semi-colonFirst field spec...

question_answer

Q: EXPLAIN ALL STEPS: Convert the following assembly language instructions into hexadecimal machine lan...

A: Assembly Language: Assembly language is a low-level language. It is machine dependent language. Asse...

question_answer

Q: Arrays Write a for loop to print all elements in courseGrades, following each element with a space (...

A: Programming instructions: First, initialize the variable which takes the size of the array and an ar...

question_answer

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: A java application that uses nested for loops to print the given multiplication table is given below...

question_answer

Q: Visit the Web sites of major technology organizations {Microsoft, Oracle, and Cisco), plus two more ...

A: Websites for best security practices Microsoft creates, retains and disposes business records and in...

question_answer

Q: WHAT IS CRYPTOCURRENCY AND EXPLAIN THE CRYPTOCURRENCY?

A: Cryptocurrency:Cryptocurrency refers to a digital asset that is derived for working as a medium of e...

question_answer

Q: 1. Why do we need data structures? Provide an example of each.2. Discuss a mathematical model and im...

A:  Data structure:Data structure is defined as a collection of data values, operations that are perfor...

question_answer

Q: C++ program   This assignment is about array operations. Create an array with 1000 items and fill it...

A: Create a C++ program and initialize a macro N with value 1000.In the main method declare an array "a...

question_answer

Q: Consider the window size is 10, bandwidth is 1500 bps, transmission delay is 2 ms atpropagation dela...

A: Given information:

question_answer

Q: Python 3.7.4 Write a statement to open the file priceList.txt for writing.

A: To open the file priceList.txt for writing, the statement is: f=open('priceList.txt','w')The followi...

question_answer

Q: What is the difference between hardware interrupts and software interrupts and give examples of situ...

A: Hardware interrupts:The physical signals either from within the microcontroller itself or may be fro...

question_answer

Q: What is the SQL command for the following, using the data attached: Find the total of the balances f...

A: Writing a SQL query to display data of customers whose balance are less than their credit limits and...

question_answer

Q: Assignment First, launch NetBeans and close any previous projects that may be open (at the top menu ...

A: A Java program that prompts the user for five to ten numbers, and calculates the average of those nu...

question_answer

Q: What is the mantisa and exponent value if 6.75 represnt in 8 bit binary floating point

A: The mantissa and exponent value of 6.75 can be obtained by converting the given decimal number into ...

question_answer

Q: Select the FSMO role that is required to be online to facilitate the addition or removal of a domain...

A: Domain Controller:Domain controller is a server computer on Microsoft servers.The purpose of domain ...

question_answer

Q: I need help with this programming exercise:   Write a C++ console application that allows your user ...

A: Before solving this problem our first duty is to understand what question is asking:Here user wants ...

question_answer

Q: Language - Java   Create a utility class called DuplicateCounter. Create an instance method called c...

A: Program InstructionsDeclare a map of Strings and create two methods count() and write() in Duplicate...

question_answer

Q: Consider the sender A transmits 12 data packets to B using stop wait 3rd packet is lost while transm...

A: In stop wait protocol, both the sender and receiver have a windows size of one. The lost packets in ...

question_answer

Q: Write a program in Python that calculates the area of a circle. Begin by assigning 3.1416 to a prope...

A: Create a PYTHON program that imports the "math" module and "const" module that we have created in an...

question_answer

Q: EXPLAIN ALL STEPS: Convert the following machine language instructions into assembly language, assum...

A: a.82B7DEConvert the above machine language into binary format1000 0010 1011 0111 1101 11101000 raaaT...

question_answer

Q: java write a app that prompts the user for the number of miles and outputs the conversion to kilomet...

A: Program DescriptionA java JavaX application is written which accepts user input in miles and display...

question_answer

Q: Too Many Networks While attempting to connect to the wireless network at your job, you notice that f...

A: Selecting the appropriate wireless network:The user can determine the wireless network to which he/s...

question_answer

Q: Pinned below

A: Explanation:Instruction lw loads the value of var_x in the register $s0.Instruction lw loads the val...

question_answer

Q: x = 2, y =1, z =3, what is the value of x, y, z after executing the following codes? switch(x) { cas...

A: Code (in java)-class Main{public static void main (String [] args){int x = 2, y =1, z =3;//initializ...

question_answer

Q: 4.7: Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine ...

A: Following is the c++ program:Variables used:startHours, startMins are used to store the starting tim...

question_answer

Q: Consider the function definition:  void GetNums(int howMany, float&amp; alpha, float&amp; beta) ...

A: When GetNums function is calledWhen the GetNums function is called, then at first the run time compi...

question_answer

Q: DISCUSS CRYPTOCURRENCY WITH A SUITABLE EXAMPLE?

A: Cryptocurrency:Cryptocurrency refers to a digital asset that is derived for working as a medium of e...

question_answer

Q: Using DeMorgan's Law, write an expression for the complement of F ifF(x,y,z) = xz' (xy + xz)+ xy'(wz...

A: Expression:

question_answer

Q: Suppose you have two columns, [Text1] and [Text2], in a MS Access table, how do you enforcethat only...

A: Validation rule to have value in one column:[Text1] and [Text2] are the two columns in a MS access t...

question_answer

Q: Evaluate cloud computing in relation to each of these four (4) criteria Dependable Manageable Adapta...

A: DescriptionEvaluating cloud computing in relation to the following four criteria’s:DependableDependa...

question_answer

Q: Design a reasonably efficient algorithm for solving each of the following problems and determine its...

A: Instructions:Initialize 50 state counters Count[] to zero.Traverse the given list of n student recor...

question_answer

Q: Hey i need help with coding in c++  Q1 // with steps  Write a program that determines a student’s gr...

A: Approach for the program- 1)Import the essential headers.2)Define the main function.3)Declare the va...

question_answer

Q: Describe the activities that occur during project development.

A: Project development is a process in which resources are planned, organized and coordinated to achiev...

question_answer

Q: The logic will allow the user to: Load a single dimensional array of size 50 with a random number T...

A: Header file #include&lt;stdlib.h&gt; included for srand function.Char ch declared to hold ‘Y’ or ‘N’...

question_answer

Q: I have to code the game mastermind, but i only got halfway. I got the user input, 8 colors and the 3...

A:  solving the duplication problem:Create a temporary array named "temp" and initiate that array with ...

question_answer

Q: If originally x = 4, y = 0, and z = 2, which is the value of x, y and z after executing the followin...

A: Code(in Java)-class Main{            public static void main(String[] args)            {            ...