Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For a) and b) below, insert the following elements in this order: 70, 21,49,60,

ID: 3713322 • Letter: F

Question

For a) and b) below, insert the following elements in this order: 70, 21,49,60, 59, 39. For each table, TableSize- 10, and you should use the primary hash function h(k)- k%10. If an item cannot be inserted into the table, please indicate this and continue inserting the remaining values. 8. b) Separate chaining hash table-use a inked list for each bucket where the values are ordered by increasing value Quadratic probing hash table tD a) What is the load factor in Table b)? b) What is the worst case running time of a find operation in table b?

Explanation / Answer

h(k) = k%10

a) Quadratic probing has table

Insert 70:

0

70

1

2

3

4

5

6

7

8

9

Insert 21:

0

70

1

21

2

3

4

5

6

7

8

9

Insert 49:

0

70

1

21

2

3

4

5

6

7

8

9

49

Insert 60 (collision at 0):

0

70

1

21

2

60

3

4

5

6

7

8

9

49

Insert 59(collision at 9):

0

70

1

21

2

60

3

59

4

5

6

7

8

9

49

Insert 39(collision at 9):

0

70

1

21

2

60

3

59

4

39

5

6

7

8

9

49

b) Chaining:

Insert 70:

0

70

1

2

3

4

5

6

7

8

9

Insert 21:

0

70

1

21

2

3

4

5

6

7

8

9

Insert 49:

0

70

1

21

2

3

4

5

6

7

8

9

49

Insert 60 (collision at 0):

0

70, 60

1

21

2

3

4

5

6

7

8

9

49

Insert 59(collision at 9):

0

70, 60

1

21

2

3

4

5

6

7

8

9

49, 59

Insert 39(collision at 9):

0

70, 60

1

21

2

3

4

5

6

7

8

9

49, 59,39

Load factor in table b, ? : Number of keys/Number of slots = 6/10 = 0.6

Worst case running time of find operation: O(1+ ?)

0

70

1

2

3

4

5

6

7

8

9

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote