Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the code in C++ and show the snapshot of output. Your task is to build a hash table and use singly linked list to

Write the code in C++ and show the snapshot of output.

image text in transcribed

Your task is to build a hash table and use singly linked list to address collisions. The objects that your list must hold are stocks consisting of a String 'Name', unsigned int 'Code', and int 'Price', and of course an object array (Hint: it would be helpful if your array is type node *inventory[MAX SIZE]; Where node is an object which holds a Stock and a Node" next.) From your main program insert 500 stocks into your table, which can hold 2000 stocks, by creating a hash function that will return your the index where the stock was inserted. Your hash function should reduce collisions as much as possible; however, if you do encounter a collision use singly linked lists to address it. Finally write a short function that analyses your collision rate (you can accomplish this by dividing the total number of stocks by the spaces filled in the table ABC 0001 13.25 LNV 0001 5025 NULL CYS 0002 1005 NULL CTX 1997 89.2 1997 1998 NULL

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions