Question: package MissingNumber; import java.lang.Math; public class Oracle { long [ ] data; / / Creates a new oracle, ready to be told all numbers /

package MissingNumber;
import java.lang.Math;
public class Oracle {
long[] data;
// Creates a new oracle, ready to be told all numbers
//(in any order) from 1 to 1000000, except for one or two.
//
// Must run in O(1) time.
Oracle()
{
}
// Tells the oracle a number between 1 and 1000000 not yet told.
//
// Must run in O(1) time.
void tell(int i)
{
}
// If every number between 1 and 1000000 except one have
// been told, and no number has been told more than once,
// sets MissInt[0] equal to the one number not yet told.
//
// Otherwise has undefined behavior.
//
// Must run in O(1) time.
void missing_one(int[] MissInt)
{
}
// If every number between 1 and 1000000 except two have
// been told, and no number has been told more than once,
// sets MissInt[0] and MissInt[1] equal to the two numbers
// not yet told (where MissInt[0]< MissInt[1]).
//
// Otherwise has undefined behavior.
//
// Must run in O(1) time.
void missing_two(int[] MissInt)
{
}
}

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!