📄 tr_ht_hash_2.cc
字号:
// file: tr_ht_hash_2.cc//// isip include files//#include "train_hash_table.h"#include "train_hash_table_constants.h" // method: hash_string_cc//// arguments:// char_1* str : (input) the string to be hashed//// return: an int_4 with the hash index//// this method computes the hash index for the given string using the// standard hash function in Kernighan & Ritchie (pp 144)//int_4 Train_Hash_table::hash_string_cc(char_1* str_a) { // index variable // uint_4 index = (uint_4)0; // create the index for the given string // for (char_1* pos = str_a; *pos != (char_1)ISIP_NULL; pos++) { index = *pos + TRAIN_HASH_TABLE_FACTOR * index; } index = index % (uint_4)size_d; // exit gracefully // return (int_4)index;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -