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

Method lessThan

src/class187/Code02_Cobweb1.java:162–174  ·  view source on GitHub ↗
(int[] arr, int len, int num)

Source from the content-addressed store, hash-verified

160 }
161
162 public static int lessThan(int[] arr, int len, int num) {
163 int l = 1, r = len, mid, ans = 0;
164 while (l <= r) {
165 mid = (l + r) >> 1;
166 if (arr[mid] < num) {
167 ans = mid;
168 l = mid + 1;
169 } else {
170 r = mid - 1;
171 }
172 }
173 return ans;
174 }
175
176 public static void dfsLeft(int u, int fa, int red, int black, long path) {
177 if (u <= n) {

Callers 1

dfsRightMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected