forked from txs72/JavaTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCh19Q017.java
More file actions
executable file
·25 lines (23 loc) · 909 Bytes
/
Ch19Q017.java
File metadata and controls
executable file
·25 lines (23 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* */ package ch19;
/* */
/* */
/* */ public class Ch19Q017
/* */ {
/* */ public static void main(String[] args) {
/* 7 */ int[] srcArray = { 3, 5, 11, 17, 21, 23, 28, 30, 32, 50, 64, 78, 81, 95, 101 };
/* 8 */ System.out.println(BinarySearch.binSearch(srcArray, 0, srcArray.length - 1, 81));
/* 9 */ System.out.println(BinarySearch.binSearch(srcArray, 81));
/* */
/* */
/* 12 */ Integer[] myArray = new Integer[srcArray.length];
/* 13 */ for (int i = 0; i < myArray.length; i++) {
/* 14 */ myArray[i] = Integer.valueOf(srcArray[i]);
/* */ }
/* 16 */ System.out.println(
/* 17 */ BinarySearch.binSearch2(myArray, Integer.valueOf(81)));
/* */ }
/* */ }
/* Location: /Volumes/TXS.128G/hope useful/practice/2020.jar!/ch19/Ch19Q017.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/