Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ swap
Method
swap
Java/Leetcode/Leetcode125.java:38–43 ·
view source on GitHub ↗
(StringBuilder s,int a,int b)
Source
from the content-addressed store, hash-verified
36
}
37
38
static
void
swap(StringBuilder s,
int
a,
int
b){
39
char temp;
40
temp=s.charAt(a);
41
s.setCharAt(a,s.charAt(b));
42
s.setCharAt(b,temp);
43
}
44
}
Callers
1
reverse
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected