Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

What is a cost driver?

Answered: 1 week ago

Question

=+c. the impact of higher national saving on economic growth

Answered: 1 week ago