Hashtable1 C언어로 만든 Hash Table C언어로 만든 Hash Table 이다. #include #include #include #define MAX_ITEM_NAME_LEN 3 #define Max_Hash_Slot 2 typedef struct ItemTotal { char name[MAX_ITEM_NAME_LEN]; int total; struct ItemTotal* next; } ItemTotal; int hash(char* str) { // Hash function taken from https://stackoverflow.com/a/7666577 unsigned long hash = 5381; int c; while ((c = *str++) != '\0') hash = ((hash name, name) == 0) { cur->tot.. 2023. 5. 12. 이전 1 다음