Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
rotate
Method · 0.95
get
Method · 0.95
set
Method · 0.95
next
Method · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected