MCPcopy Create free account
hub / github.com/careercup/ctci / main

Method main

java/Chapter 11/Introduction/BinarySearch.java:57–65  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

55 }
56
57 public static void main(String[] args) {
58 int[] array = {3, 6, 9, 12, 15, 18};
59 for (int i = 0; i < 20; i++) {
60 int loc = binarySearch(array, i);
61 int loc2 = binarySearchRecursive(array, i, 0, array.length - 1);
62 int loc3 = binarySearchRecursiveClosest(array, i, 0, array.length - 1);
63 System.out.println(i + ": " + loc + " " + loc2 + " " + loc3);
64 }
65 }
66
67}

Callers

nothing calls this directly

Calls 3

binarySearchMethod · 0.95
binarySearchRecursiveMethod · 0.95

Tested by

no test coverage detected