Skip to content

Instantly share code, notes, and snippets.

Created October 5, 2022 14:09
What would you like to do?
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct node
string phrase;
struct node *next;
node *table[26];
int hash(string phrase);
bool unload(node *list);
void visualizer(node *list);
int main(void)
// Add items
for (int i = 0; i < 3; i++)
string phrase = get_string("Enter a new phrase: ");
// Find phrase bucket
int bucket = hash(phrase);
printf("%s hashes to %i\n", phrase, bucket);
// TODO: return the correct bucket for a given phrase
int hash(string phrase)
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment