2015-11-09 HW

posted Nov 9, 2015, 4:02 PM by Samuel Konstantinovich   [ updated Nov 9, 2015, 4:03 PM ]
The homework was told verbally in class, I didn't write it here until someone didn't know about it. Sorry!

Add to your ordered super array homework:

SuperArray:
public int indexOf(int value)  - a linear search for the 1st index that has the target value, -1 when the value is not in the SuperArray

OrderedSuperArray:
public int indexOf(int value)  - a binary search for the 1st index that has the target value, -1 when the value is not in the SuperArray
This is tricky for several reasons. 
-First make it find ANY occurrence of value in the super array, then make sure it works to find the leftmost index.
Comments