Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE 2383 Spring 2018 Exercise 4 Instructions: The Hash Table is a type of data structures that uses a mathematical function called a hash to

image text in transcribed

CSE 2383 Spring 2018 Exercise 4 Instructions: The Hash Table is a type of data structures that uses a mathematical function called a hash to determine positions of values entered into the data structure. The ideal complexity of inserts, deletes, and searches is O(1) For this exercise, you will implement the following methods for a Hash Table: A function that computes the hash of a key and the linear probing function, as well as the insert function. You will also need to implement the class for the Hash Table. For bonus points, the hashing function is worth 2 points, the linear probing function is worth 3 points, and the insert is worth 5 points Note: You need to implement a partial class for testing. The data is stored as an array of the class, with the index being the hash of a key and each array element being a pointer to a Node. The node class (which can simply be a structure), should also be created and should have a key attribute and value attribute. Find a partner and write the code to complete the two methods and the partial class When submitting your work: submit it to MyCourses as a .PDF (for short answer) or.c/h file (for code solutions) before Wednesday, March 28 at 11:59 p.m. 1. Pseudocode for Node/Hash Table class Hints: Define class Node: 1. Don't overcomplicate Key: string, public Value: Integer, public //Note: typically, "value" is templated to support multiple types, this. This is simplya data structure that stores its values in an array like a heap but for simplicity let's just support integers. Define class HashTable Table: Array of Node Pointers, private Size: Integer, private 2. Use what you've learned throughout the semester. Look at examples of code already given Table(s: Integer): Constructor, public Allocate Table of size "s." Set all pointers to NULL Size is set to "s." 3. Ask Questions if confused CSE 2383 Spring 2018 Exercise 4 Instructions: The Hash Table is a type of data structures that uses a mathematical function called a hash to determine positions of values entered into the data structure. The ideal complexity of inserts, deletes, and searches is O(1) For this exercise, you will implement the following methods for a Hash Table: A function that computes the hash of a key and the linear probing function, as well as the insert function. You will also need to implement the class for the Hash Table. For bonus points, the hashing function is worth 2 points, the linear probing function is worth 3 points, and the insert is worth 5 points Note: You need to implement a partial class for testing. The data is stored as an array of the class, with the index being the hash of a key and each array element being a pointer to a Node. The node class (which can simply be a structure), should also be created and should have a key attribute and value attribute. Find a partner and write the code to complete the two methods and the partial class When submitting your work: submit it to MyCourses as a .PDF (for short answer) or.c/h file (for code solutions) before Wednesday, March 28 at 11:59 p.m. 1. Pseudocode for Node/Hash Table class Hints: Define class Node: 1. Don't overcomplicate Key: string, public Value: Integer, public //Note: typically, "value" is templated to support multiple types, this. This is simplya data structure that stores its values in an array like a heap but for simplicity let's just support integers. Define class HashTable Table: Array of Node Pointers, private Size: Integer, private 2. Use what you've learned throughout the semester. Look at examples of code already given Table(s: Integer): Constructor, public Allocate Table of size "s." Set all pointers to NULL Size is set to "s." 3. Ask Questions if confused

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

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

Students also viewed these Databases questions

Question

What attracts you about this role?

Answered: 1 week ago

Question

How many states in India?

Answered: 1 week ago

Question

HOW IS MARKETING CHANGING WITH ARTIFITIAL INTELIGENCE

Answered: 1 week ago