#include #include #define M 5 struct node { int key; struct node *next; }; typedef struct node * NodePointer; void hashlistinitialize(void); void append_to_list(NodePointer head, char c); int hash(char c); void display_list(NodePointer head); NodePointer heads[M], tail; int main(){ int i; char c; hashlistinitialize(); printf("Input data: "); while( 1 ){ c = getchar(); if( c == '\n' ){ break; } append_to_list(heads[hash(c)], c); } /* display all lists */ for(i=0; inext = tail; for (i=0; inext = tail; } } void append_to_list(NodePointer head, char c){ /* ここにプログラムを追加 */ } int hash(char c){ /* ここにプログラムを追加 */ } void display_list(NodePointer head){ NodePointer node; node = head->next; while( node!=tail ) { printf("%c ", node->key); node = node->next; } printf("\n"); }