Skip to content

Commit c4b0bd7

Browse files
committed
Add utils method
1 parent b935e14 commit c4b0bd7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package algorithm.basic;
2+
3+
/**
4+
* Created by Jbee on 2017. 6. 5..
5+
*/
6+
public class StringReverse {
7+
}

src/test/java/utils/Utils.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,11 @@ public static int[] swapValue(int[] arr, int a, int b) {
2525
arr[b] = temp;
2626
return arr;
2727
}
28+
29+
public static char[] swapValue(char[] arr, int a, int b) {
30+
char temp = arr[a];
31+
arr[a] = arr[b];
32+
arr[b] = temp;
33+
return arr;
34+
}
2835
}

0 commit comments

Comments
 (0)