MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / swap

Method swap

StringPermutations.java:8–15  ·  view source on GitHub ↗
(String s,int a,int b)

Source from the content-addressed store, hash-verified

6 permute(0,s);
7 }
8 public static String swap(String s,int a,int b)
9 {
10 char ch[] = s.toCharArray();
11 char p=ch[a];
12 ch[a]=ch[b];
13 ch[b]=p;
14 return String.valueOf(ch);
15 }
16 public static void permute(int index, String s)
17 {
18 // bASE

Callers 1

permuteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected