Specifications: Hash Dictionary – an array named hDict with a capacity of 12 elements. Each element stores a pointer to IValue which will be the first element of the linked list for that has key. • Value List – an array named IValue with a capacity of 1000 (assume 1000 employees max). Each element stores a value that represents an Employee ID. • Pointer List – an array named IPtr with a capacity of 100. Each element stores a pointer to the next element in IValue that has the same hash key. hDict 0 1 2 3 4 5 6 7 8 9 10 11 IValue IPtr 1 2 4 4 6. 7 8. 10 11 3.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Generate pseudocode for searching for an Employee ID

I was given this example but I don't understand what it means 

an employee ID (123) is hashed into a value of 5. For hDict(5) we store a
pointer to the first available spot in lValue, which at the time of the insertion was 2. We store a value of
123 in lValue(2) and a value of null in lPtr(2) because there are no other elements right now, so we
terminate the linked list. Later on another employee ID (135) needs to be inserted. It’s hash value is
also 5. In order to find where to insert it in lValue we need to traverse the linked list to get to the last
element. The first element we come to is 2. lPtr(2) is null so we know we’re at the end of the linked list.
So we get the next empty slot in lValue, which was 3, and assign the value 3 to lPtr(2). We assign the
new Employee ID (135) to next open slot lValue(3) and set lPtr(3) to null because it now becomes the
end of the list.

Specifications:
Hash Dictionary – an array named hDict with a capacity of 12 elements. Each element stores a
pointer to IValue which will be the first element of the linked list for that has key.
• Value List – an array named IValue with a capacity of 1000 (assume 1000 employees max). Each
element stores a value that represents an Employee ID.
• Pointer List – an array named IPtr with a capacity of 100. Each element stores a pointer to the
next element in IValue that has the same hash key.
hDict
0 1
4 5 6 7 8 9
10
11
IValue
IPtr
2 4
4
5
7
8.
10
11
3,
2.
6,
Transcribed Image Text:Specifications: Hash Dictionary – an array named hDict with a capacity of 12 elements. Each element stores a pointer to IValue which will be the first element of the linked list for that has key. • Value List – an array named IValue with a capacity of 1000 (assume 1000 employees max). Each element stores a value that represents an Employee ID. • Pointer List – an array named IPtr with a capacity of 100. Each element stores a pointer to the next element in IValue that has the same hash key. hDict 0 1 4 5 6 7 8 9 10 11 IValue IPtr 2 4 4 5 7 8. 10 11 3, 2. 6,
Expert Solution
Step 1

As the hdict is pointing to lvalue which stores the Employee ID, we have to first find hash value of Employee ID. Then we have to check the pointed lvalue is the ID which we are searching. If not matching, then go to the next lvalue by lPtr pointer since the ID is inserted in the next empty slot in linked list. Continue the process until the ID searched is found. If we reaches null pointer while searching, then the Employee ID is not present. 

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY