1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
baherus [9]
3 years ago
12

Show the array that results from the following sequence of key insertions using a hashing system under the given conditions: 5,

205, 406, 5205, 8205, 307 (you can simply list the non-null array slots and their contents)
a. array size is 100, linear probing used.
b. array size is 100, quadratic probing used.
Computers and Technology
1 answer:
sergejj [24]3 years ago
3 0

Answer:

a) Linear probing is one of the hashing technique in which we insert values into the hash table indexes based on hash value.

Hash value of key can be calculated as :

H(key) = key % size ;

Here H(key) is the index where the value of key is stored in hash table.

----------

Given,

Keys to be inserted are : 5 , 205, 406,5205, 8205 ,307

and size of the array : 100.

First key to be inserted is : 5

So, H(5) = 5%100 = 5,

So, key 5 is inserted at 5th index of hash table.

-----

Next key to inserted is : 205

So, H(205) = 205%100 = 5 (here collision happens)

Recompute hash value as follows:

H(key) =(key+i) % size here i= 1,2,3...

So, H(205) =( 205+1)%100 = 206%100 = 6

So, key 205 is inserted in the 6th index of the hash table.

----------

Next Key to be inserted : 406

H(406) = 406%100 = 6(collision occurs)

H(406) =(406+1) %100 = 407%100 = 7

So, the value 406 is inserted in 7the index of the hash table.

-----------------

Next key : 5205

H(5205) = 5205%100 = 5(collision)

So, H(5205) = (5205+1)%100 = 6( again collision)

So, H(5205) = 5205+2)%100 = 7(again collision)

So, H(5205) = (5205+3)%100 = 8 ( no collision)

So, value 5205 is inserted at 8th index of the hash table.

-------------

Similarly 8205 is inserted at 9th index of the hash table because , we have collisions from 5th to 8th indexes.

-------------

Next key value is : 307

H(307) = 307%100 = 7(collision)

So, (307+3)%100 = 310%100 = 10(no collision)  

So, 307 is inserted at 10th index of the hash table.

So, hash table will look like this:

Key       index

5         5

205         6

406         7

5205 8

8205 9

307         10

b) Quadratic probing:

Quadratic probing is also similar to linear probing but the difference is in collision resolution. In linear probing in case of collision we use : H(key) = (key+i)%size but here we use H(key) =( key+i^2)%size.

Applying Quadratic probing on above keys:.

First key to be inserted : 5.

5 will go to index 5 of the hash table.

-------

Next key = 205 .

H(205) = 205%100 = 5(collision)

So. H(key)= (205+1^2)%100 = 6(no collision)

So, 205 is inserted into 6th index of the hash table.

--------

Next key to be inserted 406:

So, 406 %100 = 6 (collision)

(406+1^2)%100 = 7(no collision)

So, 406 is moved to 7th index of the hash table.

----------

Next key is : 5205

So, 5205%100 = 5 (collision)

So, (5205+1^2)%100 = 6 ( again collision)

So, (5205+2^2)%100 = 9 ( no collision)

So, 5205 inserted into 9th index of hash table.

-----------

Next key is 8205:

Here collision happens at 5the , 6the , 9th indexes,

So H(8205) = (8205+4^2)%100 = 8221%100 = 21

So, value 8205 is inserted in 21st index of hash table.

--------

Next value is 307.

Here there is collision at 7the index.

So, H(307) = (307+1^2)%100 = 308%100= 8.

So, 307 is inserted at 8the index of the hash table.

Key           Index

5                  5

205                  6

406                  7

5205                9

8205               21

307                   8

You might be interested in
True or false a mirrorless camera has a pentaprism
inessss [21]

Answer:

No the pentaprism or pentamirror are both optical viewfinder viewing systems and are not part of the mirrorless camera. Some thing the pentaprism actually operates better than the electronic viewfinder of mirrorless cameras.

Explanation:

7 0
2 years ago
Read 2 more answers
What is the output? answer = "Hi mom print(answer.lower()) I​
DerKrebs [107]
As you have included a syntax error inside your question, I will make assumptions on the code. I will assume your code is {
answer = “Hi mom”
print(answer.lower())
}

In this case the output would be “hi mom”. Please make sure to double check your questions before posting.
3 0
3 years ago
You place a new disc in an optical drive, and then double-click the drive in the operating system's file browser interface. An e
lidiya [134]

Answer:

Wait. Then you try it again

Explanation:

You wait and try again later and if this still persists, you may have to check the optical drive from the drive manager peradventure there is an issue there probably a software issue, also you may have to clean the optical drive using the cleaner disc, likewise you may need to test an old disc on the optical drive to be sure the fault is not from the disc you inserted.

7 0
3 years ago
To achieve the maximum confidentiality and integrity found in a completely secure information system would require that the syst
fgiga [73]

Answer:

The answer is "Option a".

Explanation:

Privacy is a set of rules, which limiting access to the data, and integrity ensures impartiality, accuracy, and reliability is assured to ensure, which authorized persons can have secure access to the data.

The system needs no access for everyone to achieve its secrecy and integrity contained in a completely safe data system, that's why the given statement is "true".

5 0
3 years ago
(e) The vending machine stores the quantity of items available in a database table called ITEMS
zimovet [89]

Answer:

a1,a2,62,

please mark brainliest

Explanation:

8 0
2 years ago
Other questions:
  • How can improving one’s reasoning skills also improve one’s performance on the job?
    12·2 answers
  • 3. Assume a disk drive from the late 1990s is configured as follows. The total storage is approximately 675MB divided among 15 s
    11·1 answer
  • A Windows application which demands a lot of raw processing power to execute repetitive complex calculations is a good candidate
    9·1 answer
  • Walmart store wants to compare the sales of five of its stores. Write a complete program to ask the user to enter the sales for
    12·1 answer
  • Which elements of a myth appear in this story from early babylon
    14·1 answer
  • Refer to the exhibit. A network security analyst is using the Follow TCP Stream feature in Wireshark to rebuild the TCP transact
    8·1 answer
  • Which format of image files can be inserted in html?​
    8·2 answers
  • The difference between a dot matrix printer and a line printer
    9·2 answers
  • Microsoft Word, Google Chrome, and Windows Media Player are examples of
    15·1 answer
  • One problem with _______ is that often many copies of the same document are made. <br><br>HELPPP ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!