Consider the following outline of a memoized function.
int f( int x ) { ... }
How many steps does it take to make 10000 calls to f on input x = 1000?
Consider the following definition of a function hash.
size_t hash( const char *str ) { size_t h = 0; for( ; *str != '0'; str++ ) h += *str; }
What, if anything, is wrong with hash as a hash function for null-terminated strings?