No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
the question is: Write a method with the signature: [B]public static void printABs(int n)[/B]that prints all the strings, less than or equal to length n, that can be built from the alphabet A,B. printABs must print out its strings starting from the shortest strings and ending in the longest. So, … |
|
so the question is to print out strings that appear both in the two given lists, assume each list does not contain duplicates of the same word. so with the signiture of [B]public void intersect(Node n1,Node n2)[/B] and suppose we already have another method: [B]public boolean contains(Node n, String target)[/B] … |
|
I am sort of told that O(c^n) complexity could be the case of string permutations. but what is this specific 5^n? can anyone think of a simple algorithm with O(5^n)?thx |
|
hey, can anyone help me with these comlexity problems? I tried with myself but still want some clarifications..cheer,here is the code: [CODE](a) public void printPow2(int[] values) { for (int i = 1; i < values.length; i *= 2) System.out.println(values[i]); } (b) public void maxDifference(int[] values) { int max = 0; … |