it'll store the ID (string) as the key, and the first name (string), last name (string), and en the value. You can imagine a single HashNode as follows: "123456789" "Jessica" "Wolf" "abcdef@bartleby.com" HashTable should have the following attributes and methods: Attributes 1. The dynamic array that stores the data. 2. The number of elements currently stored. 3. The maximum number of elements the container can store.

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
Create struct HashNode and class HashTable that will be used to store students' data. For each student,
it'll store the ID (string) as the key, and the first name (string), last name (string), and email (string) as
the value. You can imagine a single HashNode as follows:
"123456789"
"Jessica"
"Wolf"
"abcdef@bartleby.com"
HashTable should have the following attributes and methods:
Attributes
1. The dynamic array that stores the data.
2. The number of elements currently stored.
3. The maximum number of elements the container can store.
Methods
1. Constructor that takes from the user the maximum size of the container.
2. void insert(string ID, string firstName, string lastName, string email): uses the
following hash function h2(h1(ID)) to map the key to a specific index in the table:
• h1(ID):
ww
IDLength -1
Σ
ID
• h2(K) -> [0, N-1], where N is the table size
In case the index that the hash function generated was already full, the insert
function should add the student information in a chain (list) in the same index,
applying the concept of separate chaining.
3. bool updateEmail(string ID, string newEmail): updates the email of a specific
student of his/her ID was found and returns true. If the ID wasn't found, it returns
false.
Transcribed Image Text:Create struct HashNode and class HashTable that will be used to store students' data. For each student, it'll store the ID (string) as the key, and the first name (string), last name (string), and email (string) as the value. You can imagine a single HashNode as follows: "123456789" "Jessica" "Wolf" "abcdef@bartleby.com" HashTable should have the following attributes and methods: Attributes 1. The dynamic array that stores the data. 2. The number of elements currently stored. 3. The maximum number of elements the container can store. Methods 1. Constructor that takes from the user the maximum size of the container. 2. void insert(string ID, string firstName, string lastName, string email): uses the following hash function h2(h1(ID)) to map the key to a specific index in the table: • h1(ID): ww IDLength -1 Σ ID • h2(K) -> [0, N-1], where N is the table size In case the index that the hash function generated was already full, the insert function should add the student information in a chain (list) in the same index, applying the concept of separate chaining. 3. bool updateEmail(string ID, string newEmail): updates the email of a specific student of his/her ID was found and returns true. If the ID wasn't found, it returns false.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
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