1.a) 1.b ) 1.c ) 1.d ) 2.a ) 2.b )

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1.a) 1.b ) 1.c ) 1.d ) 2.a ) 2.b )

Post by answerhappygod »

1.a)
1 A 1 B 1 C 1 D 2 A 2 B 1
1 A 1 B 1 C 1 D 2 A 2 B 1 (85.74 KiB) Viewed 36 times
1.b )
1 A 1 B 1 C 1 D 2 A 2 B 2
1 A 1 B 1 C 1 D 2 A 2 B 2 (277.3 KiB) Viewed 36 times
1.c )
1 A 1 B 1 C 1 D 2 A 2 B 3
1 A 1 B 1 C 1 D 2 A 2 B 3 (69.92 KiB) Viewed 36 times
1.d )
1 A 1 B 1 C 1 D 2 A 2 B 4
1 A 1 B 1 C 1 D 2 A 2 B 4 (116.57 KiB) Viewed 36 times
2.a )
1 A 1 B 1 C 1 D 2 A 2 B 5
1 A 1 B 1 C 1 D 2 A 2 B 5 (99.92 KiB) Viewed 36 times
2.b )
1 A 1 B 1 C 1 D 2 A 2 B 6
1 A 1 B 1 C 1 D 2 A 2 B 6 (54.86 KiB) Viewed 36 times
Linear probing is one of the methods to solve a collision in hashing. If a hashing function is defined as h(k) = k % 7, show the linear probing equation and explain how it works. (4 markah/marks)
"/ Given that there are six workers in a shop, with IDS 909, 185, 657, 116, 85, and 150. Suppose hash table HT is of the size 7 and indexed 0, 1, 2, .. 6. Show how these workers' IDs, in the order given, are inserted in HT using the hashing function h(k) = k % 7. Use linear probing to resolve any collisions. Answer by using Table 1 and explain all collisions in the hash table. Jadual 1: Jadual cincang dan data Table 1: Hash table and data HT[0] HT[1] HT[2] HT[3] HT[4] HT[5]
Illustrate the chaining for IDs listed in (b). Hashing function is defined as h(k)= k % 7. (5 markah/marks)
Analyze the collision resolution between open addressing with a linear probing approach and a chaining approach. Which approach is most suitable for the ID hashing as discussed in (b)? Explain your answer. (3 markah/marks)
Given a list of items: 80, 57, 65, 30, 45, 77, 27, 4, 90, 54, 45, 2, 63, 38, 81, 28, 62. Illustrate the sorting of the list using Shellsort using a range of 7, 4, and 1. (12 markah/marks)
Illustrate the sorting of the list using Selection Sort. (8 markah/marks)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply