Click here to Skip to main content
15,904,339 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 940 Pin
Shane010314-Jan-24 16:44
Shane010314-Jan-24 16:44 
GeneralRe: Wordle 940 Pin
Amarnath S14-Jan-24 17:02
professionalAmarnath S14-Jan-24 17:02 
GeneralRe: Wordle 940 Pin
GKP199214-Jan-24 17:58
professionalGKP199214-Jan-24 17:58 
GeneralRe: Wordle 940 Pin
OriginalGriff14-Jan-24 20:27
mveOriginalGriff14-Jan-24 20:27 
GeneralRe: Wordle 940 Pin
ChandraRam14-Jan-24 22:27
ChandraRam14-Jan-24 22:27 
GeneralRe: Wordle 940 Pin
Sander Rossel14-Jan-24 23:31
professionalSander Rossel14-Jan-24 23:31 
GeneralRe: Wordle 940 Pin
Cp-Coder15-Jan-24 1:44
Cp-Coder15-Jan-24 1:44 
GeneralUsing HASH Tables. Looking for general discussion on this topic. Pin
jmaida14-Jan-24 15:08
jmaida14-Jan-24 15:08 
I have been using HASH Tables for many applications.
1. Keyword lookup for command line processing
2. Generic name lookup tables of names, etc.
3. Substitution for binary tree name lookup that do not require a minimum guaranteed lookup time
I like HASH tables because they are easy to implement,
but the key question is what HASH function does one use.
Here is one I use:
unsigned int HASH_Value( char *name )
{
unsigned long int hashval;
int i;

hashval = 0;
for( i = 0; i < HASH_MAX_NAME_SIZE; i++ )
{
if( name[i] == '\0' ) break;
hashval += name[i] * i + 1;
}
return( (unsigned int)(hashval)%HASH_MAX_TABLE_SIZE );
/* traditional hash function
for( hashval = 0; *name != '\0'; name++ ) hashval = *name + 31 * hashval;
return ( hashval % HASH_MAX_TABLE_SIZE );
*/
}
It works for me, what works for you?
Please ignore any typos. Just looking for discussion on the topic.
"A little time, a little trouble, your better day"
Badfinger

GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
Peter_in_278014-Jan-24 15:29
professionalPeter_in_278014-Jan-24 15:29 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida14-Jan-24 15:51
jmaida14-Jan-24 15:51 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
Greg Utas14-Jan-24 18:54
professionalGreg Utas14-Jan-24 18:54 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida15-Jan-24 17:11
jmaida15-Jan-24 17:11 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
Greg Utas15-Jan-24 19:04
professionalGreg Utas15-Jan-24 19:04 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida16-Jan-24 13:42
jmaida16-Jan-24 13:42 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
megaadam14-Jan-24 22:31
professionalmegaadam14-Jan-24 22:31 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
den2k8814-Jan-24 23:52
professionalden2k8814-Jan-24 23:52 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jschell15-Jan-24 4:58
jschell15-Jan-24 4:58 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida15-Jan-24 11:48
jmaida15-Jan-24 11:48 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
BernardIE531715-Jan-24 5:03
BernardIE531715-Jan-24 5:03 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida15-Jan-24 11:50
jmaida15-Jan-24 11:50 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jmaida15-Jan-24 14:15
jmaida15-Jan-24 14:15 
GeneralRe: Using HASH Tables. Looking for general discussion on this topic. Pin
jschell16-Jan-24 4:35
jschell16-Jan-24 4:35 
GeneralFound this on Reddit, and... Pin
Brisingr Aerowing14-Jan-24 14:19
professionalBrisingr Aerowing14-Jan-24 14:19 
GeneralRe: Found this on Reddit, and... Pin
trΓΈnderen14-Jan-24 16:13
trΓΈnderen14-Jan-24 16:13 
GeneralBalmy weather we're having Pin
k505414-Jan-24 4:44
mvek505414-Jan-24 4:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.