Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*Question 1) Use the hash function in directory q1 (assign3_q1_hash_chain.cpp), please complete the code in main(). Sample input: 5 lindelof 2 bailly 3 ronaldo 7

image text in transcribed
*Question 1) Use the hash function in directory q1 (assign3_q1_hash_chain.cpp), please complete the code in main(). Sample input: 5 lindelof 2 bailly 3 ronaldo 7 jones 4 ronaldo 7 Output: 12 23 37 37 The first row in the input file indicates the number of rows in data. The input file contains 5 lines of (name and back number) of football players. For example, Christano Ronaldo have a back number 7 playing for Manchester United (ronaldo 7). Each row will be added to the hash table in order (1, 2, 3, 4 ...) along with the unique back number. If there is a duplicate of player name, then print its adding order (ronald was added at third here) and back numbers. Complete the code and show the result using the data file in the directory. *Question 2) Use another hash function, string_to_hash(), in q2. But this time, just simply print out the player and its corresponding key. e.g.) lindelof 4900454 bailly 109577017 *Question 3) Using files in directory q3, please complete the following: Complete the code for "inOrder', 'postOrder', 'levelOrder', and main() in binary Tree Traversals.cpp. The input tree and output format are described under the comment. Complete your Makefile to compile your code. The empty Makefile is provided in the directory. Please refer to https://www.cs.swarthmore.edu/~newhall/unixhelp/howto_makefiles.html for more information

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions