Question: int hash ( int base, char * s ) takes an arbitrary integer and a null - terminated character string, and returns an index into

int hash(int base, char *s) takes an arbitrary integer and a null-terminated character
string, and returns an index into an array of length TABLESIZE. The precondition says that the
string is no longer than MAXSTRING bytes; the values of the bytes of the string are otherwise
unconstrained.
b. int32 foo(char *s,int limit) maps a null-terminated C string to a 32-bit integer in the
range 0 to limit. The string may be assumed to contain only printable ASCII characters, but
the length is not constrained.
c. int process(record_t *r, int size, unsigned int serial). The arguments are a non-
NULL pointer to an array of type record_t, the number of elements in the array, and a serial
number. The type record_t is defined as follows:
typedef struct {
unsigned int quantity;
unsigned int serial;
char location[10];
}
Each record represents a part that is stored in a location. The return value is the number of
locations that have at least one item with the indicated serial number.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!