What is the current value of the tables load factor

Assignment Help Data Structure & Algorithms
Reference no: EM131280902

Question 1

Assume the utilization of linear probing for hash-tables. To enhance the complexity of the operations performed on the table, a special AVAILABLE object is used. Assuming that all keys are positive integers, the following two techniques were suggested in order to enhance complexity:

i) In case an entry is removed, instead of marking its location as AVAILABLE, indicate the key as the negative value of the removed key (i.e. if the removed key was 16, indicate the key as -16). Searching for an entry with the removed key would then terminate once a negative value of the key is found (instead of continuing to search if AVAILABLE is used).

ii) Instead of using AVAILABLE, find a key in the table that should have been placed in the location of the removed entry, then place that key (the entire entry of course) in that location (instead of setting the location as AVAILABLE). The motive is to find the key faster since it now in its hashed location. This would also avoid the dependence on the AVAILABLE object.

Will either of these proposal have an advantage of the achieved complexity? You should analyze both time-complexity and space-complexity. Additionally, will any of these approaches result in misbehaviors (in terms of functionalities)? If so, explain clearly through illustrative examples.

Question 2

To reduce the maximum number of collisions in the hash table described in Question 6 above, someone proposed the use of a larger array of 15 elements (that is roughly 15% bigger) and of course modifying the hash function to: h(k)=k mod 15. The idea was to reduce the load factor and hence the number of collisions.

Does this proposal hold any validity to it? If yes, indicate why such modifications would actually reduce the number of collisions. If no, indicate clearly the reasons you believe/think that such proposal is senseless.

Question 3

Assume an open addressing hash table implementation, where the size of the array N = 19, and that double hashing is performed for collision handling. The second hash function is defined as:
d(k) = q - k mod q,

where k is the key being inserted in the table and the prime number q is = 11. Use simple modular operation (k mod N) for the first hash function.
i) Show the content of the table after performing the following operations, in order:
put(38), put(15), put(43), put(22), put(71), put(8), put(28), put(37), put(19).
ii) What is the size of the longest cluster caused by the above insertions?
iii) What is the number of occurred collisions as a result of the above operations?
iv) What is the current value of the table′s load factor?

Reference no: EM131280902

Questions Cloud

Equal employment opportunity and affirmative action : Assume that you are the director of diversity for Coca-Cola Corporation, and you are going to be speaking at a meeting of the senior executive team to discuss a new diversity initiative. The CEO asks if this is in response to recent EEOC lawsuits. co..
Sketch a temperature-entropy diagram for this flow : For maximum flow, determine the values of static temperature, static pressure, stagnation temperature, stagnation pressure, and flow velocity at the inlet [section (1)] and exit [section (2)] of the constant area duct. Sketch a temperature-entropy..
Briefly describe one of the videos viewed : Watch at least two videos, briefly describe one of the videos viewed, and provide a summary of information the video contained and how it fits in with this unit.
Identify the non statutory labor exemption : Identify the "non-statutory labor exemption" and explain its significance.- Did the non-statutory labor exemption from the antitrust laws expire upon the parties reaching bargaining impasse?
What is the current value of the tables load factor : COMP 352: Data Structure and Algorithms - To enhance the complexity of the operations performed on the table, a special AVAILABLE object is used. Assuming that all keys are positive integers, the following two techniques were suggested in order to ..
The rise of the robots : Knowing the book "The Rise of the Robots' by Martin Ford, do you think robots will bring about a change in the world on a scale similar to that of the steam engine, electricity or the internet? What do the rise of the robots mean for you as a worker ..
Natural rate of unemployment appropriate : What is the real wage? Suppose the mark-up increases to 10%. What happens to the naturalrate of unemployment for the same reservation wage? Is the word "natural" in the natural rate of unemploymentappropriate? Why or why not? Describe in less than 5 ..
What three early common law doctrines were applied : What three early common law doctrines were applied to labor organizations?- What is the present status of the so-called yellow-dog contract?
Discuss your views and current debates on globalization : Evaluate your experiences with strategy as it relates to globalization. Discuss your views and current debates on globalization. For example, discuss how globalization leads to instability and causes lower wages, or discuss how employment practices a..

Reviews

len1280902

11/18/2016 1:29:19 AM

Both the written part and the programming part must be done individually or by team of max 2 students. Submit all your answers to written questions in PDF (no scans of handwriting) or text formats only. Please be concise and brief (less than ¼ of a page for each question) in your answers. For the Java programs, you must submit the source files together with the compiled executables. The solutions to all the questions should be zipped together into one .zip or .tar.gz file and submitted via EAS. You may upload at most one file to EAS. For the programming component, you must make sure that you upload the assignment to the correct directory of Assignment 3 using EAS. Assignments uploaded to the wrong directory will be discarded and no resubmission will be allowed. You will need to submit both the pseudo code and the Java program, together with your experimental results. Keep in mind that Java code is not pseudo code.

len1280902

11/18/2016 1:28:25 AM

I need help with the programming question which is the last one along with questions 6,8 and 9 in the first part. let me know if this is possible. Give reasons to support your statements. Write your initial response in approximately 200 words. Apply APA standards to citation of sources.

Write a Review

Data Structure & Algorithms Questions & Answers

  Finding approximation algorithm and ratio of the algorithm

finding approximation algorithm and the ratio of the algoirthm.

  Design an algorithm (no code) just using if-then statement

Provide an example of an input string that is in the proper format and an example that is not in the proper format. Describe how your algorithm determines that the first string is in the proper format and that the second string is not in proper fo..

  Write a c algorithm that calculates the area

Write a C algorithm that calculates the area under the curve y = f (x) for c ≤ x ≤ d: f is a 4th order polynomial function f (x) = a0 + a1x + a2x2 + a3x3 + a4x4

  Determining worst-case time complexity

The recent discovery of the following fragment of uncommented procedural C code in the Sunlab has caused a big scandal. What is the worst-case time complexity of foo(a,1,N,k), and for which inputsdoes it occur?

  Design algorithm to read a file of employee records

Design an algorithm and souce code C++ that will read a file of employee records and produce a weekly report of gross earnings for those employees.

  Create a node structure

Create a Node structure. Initialize the number variable to -1 and the nextNode pointer to nullptr - Add the even numbers between 0 and 40 to the list. Your list will therefore have 20 numbers in it at that point.

  Suppose n gt 1 is a natural number and f z rarrn 0 is the

1. find q and r as defined in the division algorithm when a 549 and b 2362. suppose n gt 1 is a natural number and f

  How many parameters must be estimated to train

Consider a naive Bayes classifier with 3 boolean input variables, X1, X2 and X3, and one boolean output, Y. How many parameters must be estimated to train such a naive Bayes classifier? (you need not list them unless you wish to, just give the tota..

  Analyze the time-space complexity of algorithms

How a vEB tree can be used to support these three operations and analyze the time/space complexity of your algorithms.

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Data structure using an array

Objective will be to construct your first list data structure using an array.

  Let t be the degree of a btree

Let t be the degree of a BTree. Suppose the size of each object, including the key, stored in the tree is 90 bytes. Also, suppose the size of a BTreeNode pointer is 4 bytes.

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