MCPcopy Create free account
hub / github.com/careercup/CtCI-6th-Edition / get

Method get

Java/CtCILibrary/CtCILibrary/BitVector.java:21–30  ·  view source on GitHub ↗
(int i)

Source from the content-addressed store, hash-verified

19 }
20
21 public boolean get(int i) {
22 int b = vector[i / DATA_SIZE];
23 int bit_index = i % DATA_SIZE;
24
25 if (((b >> bit_index) & 1) == 1) {
26 return true;
27 } else {
28 return false;
29 }
30 }
31
32 public void print() {
33 for (int k : vector) {

Callers 2

printNodeInternalMethod · 0.45
getChildMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected