Posts by Vinicius Souza • 78 points
11 posts
-
0
votes2
answers95
viewsA: Mergesort sorting algorithm error
For some reason, the value you are passing from N is changing. Therefore, I suggest you use a #define N 6 instead of int n = sizeof(A)/4.
-
0
votes1
answer241
viewsQ: Error in Java connection to Mysql Database
I am connecting a Java application to an SQL Database, I have the following connection code: Connectionfactory.java.: package connection; import java.sql.Connection; import java.sql.DriverManager;…
-
0
votes1
answer80
viewsA: Casting error
The casting is first to pass the Object to String and then to Integer. The code looks like this : int solucao(String palavra2) { Pilha pilha = new Pilha(); int resultado = 0; for(int i = 0; i <…
-
0
votes1
answer97
viewsA: Press factorization using Stack
Simply set "i =+ 2" to "i += 2" public class Exercicio5 { int fatorPrimo(int n) { int resultado = 1; Pilha pilha = new Pilha(); while (n % 2 == 0) { n = n / 2; pilha.push(2); } for(int i = 3; i…
-
0
votes1
answer183
viewsQ: Problem to add at the end of a Simple Chained List
I have a simple chained list and need to do a recursive function that adds at the end of the list an element, I already have the function without recursiveness, but the with recursiveness is giving…
-
1
votes2
answers482
viewsQ: Error comparing strings
I need to make a program that takes a sentence, then a letter, and returns how many times the letter appears in the sentence. So I did this: import java.io.BufferedReader; import…
-
0
votes1
answer544
viewsQ: Simple Chained List
I’m having trouble removing an item at the end of the list Defining the knot: class Node { Node proximo; int chave; Node(int chave) { this.chave = chave; } } Simple Chained List: class ListaLigada {…
-
1
votes2
answers140
viewsQ: Substring program
I have a C program that displays all substrings of a string: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef char string[100]; void substrings(string str) { if…
-
0
votes2
answers45
viewsA: Print subtrings recursively
Follow the desired code: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef char string[100]; void substrings(string str) { if (strlen(str) >= 1) { puts(str);…
-
-3
votes2
answers45
viewsQ: Print subtrings recursively
I need to print substrings for a string, for example: OPEN, substrings are OPEN, OPEN, ABR, AB, A. How do I do this? 'Cause all I’m doing is printing the whole string. #include <stdio.h>…
-
0
votes0
answers76
viewsQ: Score critical point on the surface - Matlab
I am making this script to mark the critical point on the surface, only it is giving error : "Error in teste2 (line 26) Plot(Xs(1),Xs(2),'r*')", someone can help me? clc clear H=[2 -2;-2 4];…
matlabasked Vinicius Souza 78