Basic Hash programming

Basic Hash programming Hash.h =====  /**************************************************************************  *   A simple hash table implementation for strings.  ***************************************************************************/ #ifndef HASH_H #define HASH_H  typedef struct hash_t {   struct hash_node_t **bucket;      /* array of hash nodes */   int size;                         /* size of the array */   int entries;                      /* number of entries in table */   int downshift;                    /* shift count, used in hash function […]

Algorithm complexity

Searching Algorithm Data Structure Time Complexity Space Complexity Average Worst Worst Depth First Search (DFS) Graph of |V| vertices and |E| edges – O(|E| + |V|) O(|V|) Breadth First Search (BFS) Graph of |V| vertices and |E| edges – O(|E| + |V|) O(|V|) Binary search Sorted array of n elements O(log(n)) O(log(n)) O(1) Linear (Brute […]