MCPcopy
hub / github.com/careercup/ctci / convert

Method convert

java/Chapter 14/Question14_6/CircularArray.java:13–18  ·  view source on GitHub ↗
(int index)

Source from the content-addressed store, hash-verified

11 }
12
13 private int convert(int index) {
14 if (index < 0) {
15 index += items.length;
16 }
17 return (head + index) % items.length;
18 }
19
20 public void rotate(int shiftRight) {
21 head = convert(shiftRight);

Callers 4

rotateMethod · 0.95
getMethod · 0.95
setMethod · 0.95
nextMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected