-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhashtags.h
More file actions
30 lines (26 loc) · 826 Bytes
/
Copy pathhashtags.h
File metadata and controls
30 lines (26 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
============================================================================
Name : hashtags.h
Author : Alex Fiuk
Description : Header file for Hashtags program
============================================================================
*/
// the initial capacity (number of buckets)
#define CAPACITY 100
typedef struct Node node;
struct Node {
char* value;
unsigned long freq;
node* next; // next node in the list
};
typedef struct Hashtable hashtable;
struct Hashtable {
node* list[CAPACITY]; // "buckets" of linked lists
};
/* Function prototypes */
int hash(char*, unsigned long*);
int put(char*, hashtable*);
int get(char*, hashtable*);
void print_top_n_hashtags(int, hashtable*);
void refresh_lowest(unsigned long*, unsigned long*, hashtable*, int);
void sort_top_tags(int, hashtable*);