Question

Data structure and Algorithm A hash table of length 10 using open addressing with hash function...

Data structure and Algorithm

A hash table of length 10 using open addressing with hash function h(k) = k mod 10, and linear probing has been created.

0

1

2

32

3

73

4

12

5

15

6

82

7

37

8

65

9

9

Now the item 12 needs to be deleted using “Deletion with repair’. What is the resultant hash table?

A)

0

1

2

32

3

73

4

15

5

82

6

37

7

65

8

9

9

B)

0

1

2

32

3

73

4

82

5

15

6

7

37

8

65

9

9

C) None of the options provided represent the hash table that would result.

D)

0

1

2

32

3

73

4

82

5

15

6

65

7

37

8

9

9

E)

0

1

2

32

3

73

4

5

15

6

82

7

37

8

65

9

9

Homework Answers

Answer #1

The answer will be the option D

i.e

0

1
2 32
3 73
4 82
5 15
6 65
7 37
8
9 9

Because after deletion of '12' , if we search for 82 then ,

1) it first searches at index = (82%10) = 2 but it is occupied by '32'.

2) it then searches at index = ((82%10) +1)%10 = 3, it is also occupied by '73'.

3) similarly , it then searches at index = 4 and finds it empty . So the search will terminate saying that 82 is not present in table which is wrong. So, 82 must move to index = 4.

Searching for 65.

1) it first searches at index = (65%10) = 5 but it is occupied by ''15'.

2) it then searches at index = ((65%10) +1)%10 = 6 and finds it empty . So the search will terminate saying that 65 is not present in table which is wrong. So, 65 must move at index = 6.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
SHOW WORK! Draw the hash table that results using the hash function: h(k)=kmod 7 to hash...
SHOW WORK! Draw the hash table that results using the hash function: h(k)=kmod 7 to hash the keys 50, 700, 76, 85, 92, 73, 101. Assuming collisions are handled by Quadratic probing.                                                                               SHOW WORK
Which of the following statements about hashing is false? 1. A good hash function maps similar...
Which of the following statements about hashing is false? 1. A good hash function maps similar data items or records to the same hash values. 2. A good hash function uniformly distributes data items across the entire set of possible hash values. 3. A perfect hash function allows for constant time search, insertion, and deletion, into and from a hash table. 4. When using an open addressing method of collision resolution, all data records reside in a single bucket array....
The table below shows the production function for producing snack cakes. Given this information, what is...
The table below shows the production function for producing snack cakes. Given this information, what is the marginal product of the 5th worker? # of Workers Cases of Snack Cakes (#/day) 0 0 1 5 2 15 3 27 4 37 5 45 6 52 7 58 8 63 9 67 10 70 11 71 12 71 45 cases 9 cases 8 cases 5 cases Question 23 The table below shows the production function for producing snack cakes. Given this...
This dataset contains consumer responses indicating the number of times they had to send their product...
This dataset contains consumer responses indicating the number of times they had to send their product for repair and their satisfaction with the repair process. Create a graph which can be used to visually demonstrate the relationship between the two columns of data. Ensure that the chart is professional with appropriate titles, axis labels, etc. Note any observations you see in your visualization (type these as sentences directly into an Excel cell(s)). Sample Satisfaction Rating Repair Requests 1 63% 13...
Convert the Ch01_SalesSummary file to a database table in MS Access (steps: drop unnecessary titles row...
Convert the Ch01_SalesSummary file to a database table in MS Access (steps: drop unnecessary titles row and import data into Access using “External Data” Excel tab in Access). Sort the new Access database table in ascending order by any one column. Table Waitstaff Member# #Guests Hour Food Beverage Total 29 WH 0 1 8 0 4 5 28 MM 101 4 8 0 4 5 28 MM 0 2 8 5 8 15 5 LR 0 2 8 5 9...
6. Using the class data (see Blackboard file - "Class Survey Data - PSS-10 and GAS")...
6. Using the class data (see Blackboard file - "Class Survey Data - PSS-10 and GAS") calculate the correlation between the GAS – Goal disengagement and the GAS – Goal reengagement scores. Write the results in a statistical statement. 7. Using the class data calculate the correlation between the GAS – Goal disengagement and the PSS-10 scores. Write the results in a statistical statement. 8. Using the class data calculate the correlation between the GAS – Goal reengagement scores and...
Table 14-9 Suppose that a firm in a competitive market faces the following revenues and costs:...
Table 14-9 Suppose that a firm in a competitive market faces the following revenues and costs: Quantity Total Revenue Total Cost 0 $0 $10 1 $9 $14 2 $18 $19 3 $27 $25 4 $36 $32 5 $45 $40 6 $54 $49 7 $63 $59 8 $72 $70 9 $81 $82 Refer to Table 14-9. In order to maximize profit, the firm will produce a level of output where marginal reve-nue is equal to Question 31 options: a) $6. b)...
Suppose that the following frequency table contains data on the number of absences in a school...
Suppose that the following frequency table contains data on the number of absences in a school year due to illness or injury for 100 randomly selected high school students. Use the table to determine the median number of absences for these 100 students. Provide your answer with precision to one decimal place.   Number of absences     Frequency   0 25 1 10 2 10 3 5 4 9 5 12 6 9 7 9 8 4 9 2 10 3 11 2...
1) You must implement a recursive Quicksort algorithm that will read integers from the attached MyList.txt...
1) You must implement a recursive Quicksort algorithm that will read integers from the attached MyList.txt file. Your algorithm must sort the list(integers)in ascending order. 2)You must implement a recursive Mergesort algorithm that will read integers from the attached MyList.txt file. Your algorithm must sort the list(integers)in ascending order. My List txt Values 7 3 4 1 4 4 9 9 4 8 4 5 3 9 2 3 7 0 6 4 4 5 0 1 9 2 1...
Table 17-9 The table shows the demand schedule for a particular product. Quantity Price 0 16...
Table 17-9 The table shows the demand schedule for a particular product. Quantity Price 0 16 1 14 2 12 3 10 4   8 5   6 6   4 7   2 8   0 Refer to Table 17-9. Suppose the market for this product is served by two firms that have formed a cartel. If the marginal cost of production is $4 and the fixed cost is $6, the combined profit of the cartel will be A. $24 B. $6 C. $12...