MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / right

Method right

src/class006/Code01_FindNumber.java:37–44  ·  view source on GitHub ↗
(int[] sortedArr, int num)

Source from the content-addressed store, hash-verified

35 // 为了验证
36 // 保证arr有序,才能用这个方法
37 public static boolean right(int[] sortedArr, int num) {
38 for (int cur : sortedArr) {
39 if (cur == num) {
40 return true;
41 }
42 }
43 return false;
44 }
45
46 // 保证arr有序,才能用这个方法
47 public static boolean exist(int[] arr, int num) {

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected