Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For each instance, give at least one example of a corner case that you should test for that function. int hash ( int base, char

For each instance, give at least one example of a corner case that you should test for that function.
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

Step: 3

blur-text-image

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

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

5. Wyeth Pharmaceuticals

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago