Posts by Maurício • 43 points
3 posts
-
1
votes1
answer100
viewsA: Algorithm of Division and Conquest
UPDATE: I managed to solve my problem, in case someone is also in doubt I will leave my code public static int somatorio(int[] a, int inicio. int fim) { if(inicio == fim) { return a[inicio]; }else…
-
0
votes1
answer100
viewsQ: Algorithm of Division and Conquest
I’m having trouble making a division and conquest algorithm of the sum of the elements of an arrangement. public static int somatorio(int[] a, int numElem) { if(numElem == 0) { return 0; }else…
-
2
votes1
answer134
viewsQ: Recursion Doubt with String in Java
I’m trying to solve the following exercise: A string collection S is recursively defined by: 'a' and 'b' belong to S; if X belongs to S, then Xb also belongs to S; Write a procedure that implements…