train/swe_with_2nd_randomwalk.c
// Returns position of a user in the user_vocabulary; if the user is not found, returns -1
Returns position of a user in the user_vocabulary; if the user is not found, returns -1
Returns position of a user in the user_vocabulary ; if the user is not found returns - 1
int SearchUser(char *word) {
    unsigned int hash = GetUserHash(word);
    while(1) {
        if (user_hash[hash] == -1) return -1;
        if (!strcmp(word, user[user_hash[hash]])) return user_hash[hash]; 
        hash = (hash + 1) % user_hash_size;
    }
    return -1;
}
int SearchUser ( char * word ) { unsigned int hash = GetUserHash ( word ) ; while ( 1 ) { if ( user_hash [ hash ] == -1 ) return -1 ; if ( ! strcmp ( word , user [ user_hash [ hash ] ] ) ) return user_hash [ hash ] ; hash = ( hash + 1 ) % user_hash_size ; } return -1 ; }
Returns position of a user in the user_vocabulary; if the user is not found, returns -1
Returns position of a user in the user_vocabulary ; if the user is not found returns - 1
//return the position of the user_list