C hash function
i need a hash function that takes string inputs of "L1-0007835" and computes a number with low collisions
int StringIndexHash(void *string)
{
// hash function for string
int crac = 25800;
char *point;
point = (char *) string;
while (*point != '\0') { //iterate till null
crac= (result << 5) + crac+
*point; // hash it
++point; // move to next memory
location
}
return crac; // return index
}
IF YOU HAVE ANY QUERY PLEASE COMMENT DOWN BELOW
PLEASE GIVE A THUMBS UP
C hash function i need a hash function that takes string inputs of "L1-0007835" and computes...
I really need assistance with creating a C++ hash table program for generating a hash from a string. Create a hash function then test and evaluate the results. The set of strings are from a "words.txt" file (there are 45,402 words in the file, no repeating words. Map the words to 45,402 buckets using a hash function). Requirements: Create an array of 45,402 integers and initialize each to zero. These will be used to store how many times each index...
I really need assistance with creating a C++ hash table program for generating a hash from a string. Create a hash function then test and evaluate the results. The set of strings are from a "words.txt" file (there are 45,402 words in the file, no repeating words. Map the words to 45,402 buckets using a hash function). Requirements: Create an array of 45,402 integers and initialize each to zero. These will be used to store how many times each index...
Please complete the following task: Create a C++ hash table program for generating a hash from a string. Create a hash function then test and evaluate the results. The set of strings are from a "words.txt" file (there are 45,402 words in the file, no repeating words. Map the words to 45,402 buckets using a hash function). Requirements: Create an array of 45,402 integers and initialize each to zero. These will be used to store how many times each index...
[C++] Need help finishing a Palindrome Checking Function The function takes in a string and each individual character is stored in a stack. The stack is then checked to see if it is a palindrome. This is what I have so far: void palindromeCheck(string s){ stack myStack; char c; // converts string to individual chars and stored in stack for (int i = 0; i < s.size(); i++){ c = s.at(i); myStack.push(c); } // Palindrome check on stack ? }...
i need to make a simple hash function for an id in my size_t function it works it need to print out numeric numbers and it has to be six numbers i think i need a loop here what it print out input.txt bob 4517898 102 tell rd gill 4787456 103 hmm rd output.txt 126990 bob 4517898 102 tell rd 126990 gill 4787456 103 hmm rd #ifndef __CUSTOMER_H__ #define __CUSTOMER_H__ #include #include struct customer { std::string name; std::string...
Write a Python function called more() that takes three string inputs and outputs a string Formally, the function signature and output are given by rucharist, char: str words str) > str Use the same names for the input arguments as shown above Note that charl and char2 will always be a string of length 1 (ie, it is a single character. The function checks which of charl or char2 appears more often in the word string and returns that character...
IN C++ Create a student hash table that contains information, studentID (int), name (string), marks_oop345 (float). The size of hash table is equal to the number of students in the class. Use linear probing in case of collisions. Perform insertion, deletion, display and search operations.
4. Hashing and Hash Tables. You need to use the ASCII table in the last page for this question. Study the following hash functions for ASCII C strings that are at least 3-char long unsigned hash1(const char, unsigned unsigned vto]+01997 return (v % m); unsigned hash2Cconst char unsigned) unsigned v-o]k(2] 877 return 1 + (v % ( -1)); (a) Given that m-, 7, compute the hash values and fill the following table (3%) String k hash1k, ) hash2(k, 7) aph...
A palindrome is a word, phrase, number, or other sequence of symbols or elements that reads the same forward or reversed. Examples: “Dad”, “Anna”, “Never odd or even”, etc. For this problem, we will only consider a string to be palindromic if its combined alpha-numeric characters (‘A’-’Z’, ‘a’-’z’, and ‘0’-’9’) can be read the same both forward and backward, by skipping all other non-alphanumeric characters.Write the following function that takes a user input string, computes, and determines whether the input is palindromic or not...
You have a hash table of length 7 (tablesize 7). You are given a hash function f(x)-x % tablesize, where x is the value to be hashed and fix) is the hash address. Quadratic probing is used to resolve the collisions. The hash function receives the input 40, 26, 15, 12, 5, 17) in that order. Place each number in hash table in its correct address. The first two values are already placed in their correct positions If there isn't...