 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
private
int itemIndex (Student item,
|
|
|
StudentList list)
|
|
The proper place for the specified item
|
|
|
|
on the
specified list, found using
|
|
|
binary
search.
|
|
|
require:
|
|
|
list is sorted in increasing order
|
|
|
ensure:
|
|
|
0 <= result <= list.size()
|
|
|
for 0 <= i < result
|
|
|
list.get(i) < item
|
|
|
for result <= i < list.size()
|
|
|
list.get(i) >= item
|
|