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
rewona [7]
3 years ago
7

What are the advantages and disadvantages of the various collision resolution strategies for hashes?

Computers and Technology
2 answers:
Digiron [165]3 years ago
6 0

Linear probing

It does a linear search for an empty slot when a collision is identified

Advantages

Easy to implement

It always finds a location if there is one

Disadvantages

When clusters and keys fill most of the array after forming in adjacent slots of the table, the performance deteriorates

Double probing/hashing

The idea here is to make the offset to the next position probed depending on the key value. This is so it can be different for different keys.

Advantages

Good for double number generation

Smaller hash tables can be used.

Disadvantages

As the table fills up, the performance degrades.

Quadratic probing

It is used to resolve collisions in hash tables. It is an open addressing scheme in computer programming.

Advantage

It is more efficient for a closed hash table.

Disadvantage

Has secondary clustering. Two keys have same probe sequence when they hash to the same location.

sineoko [7]3 years ago
6 0

Answer:

Vector: each vector position holds one

information. If the hashing function applied to a

set of elements determine the information I1,

I2, ..., In, so the vector V [1 ... n] is used to

represent the hash table.

! Vector + Chain List: Vector contains

pointers to lists that represent the

information.

Hashing Function

! The Hashing Function is responsible for generating a

index from a given key.

! Ideally, the function should provide unique indexes for the

set of possible input keys.

! Hashing function is extremely important,

because she is responsible for distributing the information through

Hash table.

Explanation:

Hope this helps :) -Mark Brainiest Please :)

You might be interested in
python A pet shop wants to give a discount to its clients if they buy one or more pets. The discount is equal to 20 percent of t
Artyom0805 [142]

Answer:

The following are the program in the Python Programming Language.

#define function

def discount(prices, isPet, nItems):

 # declare and initialize variables to 0

 i = 0

 cost = 0

 pets = 0

 item = 0

 item_Cost = 0

 #set the while loop

 while(i < nItems):

   #check the items of the variable

   if isPet[i]:

     #add and initialize in the cost

     cost += prices[i]

     #increament in the variable by 1

     pets += 1

   #otherwise

   else:

     #add and initialize in the item_Cost

     item_Cost += prices[i]

     #increament in the variable by 1

     item += 1

   #then increment in the variable by 1

   i += 1

 #check the pet is greater than equal to 1  

 #and item is greater than equal to 5

 if(pets >= 1 and item >=5):

   #then, print the message

   print("You receive discount")

   #set discount of the items

   discount = 0.2 * item_Cost

   # calculate bill after deducting discount

   bill = cost + item_Cost - discount

   #print the bill

   print("Final Bill amount is", bill)

 #otherwise

 else:

   #print the message

   print("You do not receive any discount")

   #calculate bill without deducting discount

   bill = cost + item_Cost

   #print the final bill

   print("Final Bill amount is", bill)

#set empty list type variables

price = []

pet = []

#set the infinite loop

while True:

 #get input from the user

 sprice = int(input("Enter the price (-1 to quit): "))

 #check that price is not equal to the -1

 if(sprice != -1):

   #add price in the list

   price.append(sprice)

   #ask for choice from the user

   choice = input("Is it a pet (Y / N)? ")

   #check the choice of the user is y or Y

   if(choice == 'Y' or choice == 'y'):

     # then, add in the pet

     pet.append(True)

   #otherwise

   else:

     #not add in the pet

     pet.append(False)

   print("")

 #break the loop

 else:

   break

#declare variable that store the length

items = len(price)

#call and initialize the variable

discount(price, pet, items)

<u>Output</u>:

Enter the price (-1 to quit): 96

Is it a pet (Y / N)? y

Enter the price (-1 to quit): 69

Is it a pet (Y / N)? n

Enter the price (-1 to quit): 41

Is it a pet (Y / N)? n

Enter the price (-1 to quit): 52

Is it a pet (Y / N)? n

Enter the price (-1 to quit): 96

Is it a pet (Y / N)? n

Enter the price (-1 to quit): 74

Is it a pet (Y / N)? n

Enter the price (-1 to quit): -1

You receive discount

Final Bill amount is 361.6

Explanation:

<u>The following are the description of the program</u>.

  • Firstly, define the function 'discount()' and pass the arguments 'prices', 'isPet' and 'nItems' in its parameter.
  • Then, declare and initialize the variables 'i' to 0, 'item_Cost' to 0
  • , item to 0, 'cost' to 0 and 'pets' to 0.
  • Then, set the while loop to add the price of the items and the cost of the pets.
  • Set the if-else conditional statement to check the pet is greater than equal to 1 and the items are greater than equal to 5 then, set the discount and print the bill after deduction.
  • Otherwise, print the bill without deduction.
  • Finally, set two list type variable then, set the infinite while loop that gets input from the user and check that the variable is not equal to -1 then append the data in the list then again check the user input then append in pet otherwise not append in pet and break the loop. Then, set the variable that stores the length of the price and call the following function by passing arguments in its parameter.
8 0
3 years ago
A security utility program that scans the system for small programs that interfere with how a computer functions are _____ utili
Aneli [31]

Answer:

A security utility program that scans the system for small programs that interfere with how a computer functions are _____ utilities.

Explanation:

7 0
3 years ago
What Two external audio recorders are most commonly used ??
zimovet [89]

Answer:

Very few recorders have built-in microphones that are useful for field reporting. Does the recorder have XLR (professional grade) input, Tip-Ring Sleeve (TRS) input or just a mini jack? Format – There are two types of audio files: compressed and uncompressed. Cheap audio recorders will compress all of the audio it captures.

Explanation:

hope this helps mark as brainiest.

3 0
3 years ago
What are the supercomputers and where are they used? ​
viktelen [127]

Answer:

Giant Tech Company mostly

Explanation:

they used it as their server or storing data, right now example we googling by that we send the requests from our computer to supercomputers and those computer will find that information your and send back the respond (e.g. website Brainly). Supercomputers = computers sample as that.

6 0
2 years ago
The Internet may best be compared to a/an
Usimov [2.4K]
A volcano because its always erupting
3 0
3 years ago
Other questions:
  • Ten 9600-bps lines are to be multiplexed using TDM. a. Ignoring overhead bits in the TDM frame, what is the total capacity requi
    6·1 answer
  • Your friend Kayla is starting her own business and asks you whether she should set it up as a P2P network or as a client-server
    13·1 answer
  • This is important I need help please
    14·1 answer
  • Gap junctions and plasmodesmata have what feature in common?
    6·1 answer
  • Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the bool variabl
    6·1 answer
  • Is it possible for the front and rear references in a circular array implementation to be equal?
    8·1 answer
  • What can help an interface user understand or navigate an online interface?​
    15·1 answer
  • What year did the first hovercraft sail on water
    15·1 answer
  • What is a best practice when approaching an automation effort?
    6·1 answer
  • Write a function, called valFrequency, that given a list of values as a parameter, counts the frequencies for each value in the
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!