MCPcopy Index your code
hub / github.com/careercup/ctci / fetch

Method fetch

java/Chapter 5/Question5_7/BitInteger.java:20–23  ·  view source on GitHub ↗

Returns k-th most-significant bit.

(int k)

Source from the content-addressed store, hash-verified

18
19 /** Returns k-th most-significant bit. */
20 public int fetch(int k){
21 if (bits[k]) return 1;
22 else return 0;
23 }
24
25 /** Sets k-th most-significant bit. */
26 public void set(int k, int bitValue){

Callers 3

swapValuesMethod · 0.95
toIntMethod · 0.95
findMissingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected