| 111 | return -1; |
| 112 | } |
| 113 | int Array::BinarySearch(int key) |
| 114 | { |
| 115 | int l,mid,h; |
| 116 | l=0; |
| 117 | h=length-1; |
| 118 | |
| 119 | while(l<=h) |
| 120 | { |
| 121 | mid=(l+h)/2; |
| 122 | if(key==A[mid]) |
| 123 | return mid; |
| 124 | else if(key<A[mid]) |
| 125 | h=mid-1; |
| 126 | else |
| 127 | l=mid+1; |
| 128 | } |
| 129 | return -1; |
| 130 | } |
| 131 | int Array::Get(int index) |
| 132 | { |
| 133 | if(index>=0 && index<length) |
nothing calls this directly
no outgoing calls
no test coverage detected