Programming > Research Paper > University of Texas, Dallas - CS 3345LinearProbingHashTable (All)

University of Texas, Dallas - CS 3345LinearProbingHashTable

Document Content and Description Below

/* * CS 3345.007 * Greg Ozbirn * Project 3 - Linear Probing Hash Table * Name: Ihfaz Tajwar * */ //LinearProbingHashTable class public class LinearProbingHashTable <K,V> { private static final... int SIZE = 11; //Starting off with a default table size of 11 private int numElements; //Determines number of elements in the table //Entry class private static class Entry <K,V> { public K key; public V value; public boolean delStatus; //True if deleted //Constructor public Entry(K k, V v){ key = k; value = v; delStatus = false; } } Entry <K,V>[] table = new Entry[SIZE]; //Creation of the Hash Table //Constructor public LinearProbingHashTable(){ numElements = 0; for(int i = 0; i < table.length; i++) //Make table logically empty table[i] = null; } /******************* * HELPER METHODS * ********************/ //Determines the next number which is prime private int nextPrime(int input){ int counter; input++; while(true){ counter = 0; for(int i = 2; i <= Math.sqrt(input); i ++) if(input % i == 0) counter++; if(counter == 0) return input; else{ input++; continue; } } } /************** * METHODS * **************/ //Add entries to the hash table [Show More]

Last updated: 1 year ago

Preview 1 out of 5 pages

Reviews( 0 )

$8.00

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

GET ASSIGNMENT HELP
55
0

Document information


Connected school, study & course


About the document


Uploaded On

Mar 25, 2021

Number of pages

5

Written in

Seller


seller-icon
Muchiri

Member since 3 years

208 Documents Sold


Additional information

This document has been written for:

Uploaded

Mar 25, 2021

Downloads

 0

Views

 55

Document Keyword Tags

Recommended For You

What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·