Please Provide C++ Code for both parts. Part 1 We would like to use initials to locate an individual. For instance, MEL
Posted: Fri Jun 10, 2022 11:55 am
Please Provide C++ Code for both parts.
Part 1
We would like to use initials to locate an individual. For
instance, MEL should locate the person Mark E. Lehr. Note: this is
all upper case. Generate a hash function for the above using the
numbers on your telephone. You know, each letter has a number
associated with it, so examine your telephone keypad. Generate 512
random 3 letter initials and take statistics on a linked list array
size 512 to hold this information. Report how many have no
elements, 1 element, 2 elements, etc... Also, what is the maximum
number of collisions. Do both results agree with the hashing
statistics distribution? Show the comparison and analysis?
Part 2
Take problem 1 and put each of the 3 letters in a sorted binary
tree. Compare number of nodes to identify a match with the hash vs.
the tree. Use the AVL technique to balance the tree.
Part 1
We would like to use initials to locate an individual. For
instance, MEL should locate the person Mark E. Lehr. Note: this is
all upper case. Generate a hash function for the above using the
numbers on your telephone. You know, each letter has a number
associated with it, so examine your telephone keypad. Generate 512
random 3 letter initials and take statistics on a linked list array
size 512 to hold this information. Report how many have no
elements, 1 element, 2 elements, etc... Also, what is the maximum
number of collisions. Do both results agree with the hashing
statistics distribution? Show the comparison and analysis?
Part 2
Take problem 1 and put each of the 3 letters in a sorted binary
tree. Compare number of nodes to identify a match with the hash vs.
the tree. Use the AVL technique to balance the tree.