Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static public boolean isInPowerArray( String x, int i, String y )
- {
- String[] veldisfylki = powerArray(x);
- if (veldisfylki[i].equals(y))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- static public String[] powerArray( String x )
- {
- String[] powerArray = new String[(int) Math.pow(2, x.length())];
- for (int i = 0; i < x.length(); i++)
- {
- powerArray[i] = "";
- for (int j = 1; j < powerArray.length; j++)
- {
- powerArray[j] += "" + x.charAt(i);
- }
- }
- return powerArray;
- }
- public static void sort( String[] a )
- {
- java.util.Arrays.sort(a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement