On this page:
1 Implement binary search
2 Check your implementation with Find  Bugs
3 Randomly test your implementation
6.0.1.6

Project 0

This is a warmup exercise, to get you used to the tools we’ll be using in this class.

Due: Wednesday, Jan 29, midnight.

Submission instructions to come.

1 Implement binary search

Implement binary search on an array of numbers, in Java. The signature should be:

boolean find(int[] data, int key)

2 Check your implementation with FindBugs

You can download FindBugs here: http://findbugs.sourceforge.net/. Include comments about all the issues FindBugs identified in your program, and how you fixed them. If no issues were found, include a comment saying that.

3 Randomly test your implementation

Develop a random tester for your implementation. It should be able to generate new arrays and appropriate calls to find, and check that they behave correctly. Include comments about all the issues random testing identified in your program, and how you fixed them. If no issues were found, include a comment saying that. You must run at least 1000000 tests.