Questions tagged as 'algoritmo'

1
answer

Average is not calculated

I need to write a code that reads only 20 integer values, in the end add the positive numbers and average the negative numbers. It usually sums the positives but when it arrives at the time of the negatives it always shows the value 0. Her...
asked by 31.08.2018 / 23:43
2
answers

Do not allow repeating values in different DropDownList using jQuery?

I have 3 DropDownList where they have 4 items with the same valor (1,2,3,4). I need to respect that every DropDownList does not repeat the value selected in the others. Example: ddl0= 1 ddl1= 2 (não permitiria escolher...
asked by 17.12.2018 / 20:48
1
answer

What is the most performative way of converting an int to the sum of its digits?

I have a certain int and would like to turn it into another one that is the result of summing your digits in the best possible way. For example: int n = 2601; Should result in 9 since this is the result of 2+6+0+1 . What...
asked by 27.11.2017 / 05:50
2
answers

Cipher of vigenere

private static void algoritmo(String input, String chave, Boolean b) { Console.WriteLine("Digite a mensagem: "); input = Console.ReadLine(); Console.WriteLine("Digite a chave: "); chave = Console.ReadLine();...
asked by 19.02.2017 / 01:35
2
answers

How to preprocess a text for the application in the Weka classification algorithms in Java?

I'm doing my CBT where the idea is roughly part of collecting tweets and training a machine learning algorithm to sort this data. As I would pre-process this tweet, the idea being to train a machine-learning algorithm with inputs, where it...
asked by 28.04.2014 / 15:57
1
answer

What is the main difference between the Knuth-Morris-Pratt and Boyer-Moore algorithms

I know that KMP (Knuth-Morris-Pratt) is used to find a text Y in X, tries to set a pattern in Y, and then saves this pattern in a vector. And I also know that BM (Boyer-Moore) works best for small words. But what is the main difference in...
asked by 22.08.2017 / 15:30
1
answer

Help in struct C, failing to feed

Good morning, I'm creating this simple code, just to read, and display, this information of a vector, type struct . But when executing this code, at the time of execution, I can not feed the date or the membership, as it is explicit in...
asked by 10.07.2016 / 17:40
2
answers

How can I make a variable wait for the user to press 1 of 4 buttons?

Well, I'll try to be clearer. I have a variable called int tentativa and I want it to get a specific value depending on which button the user presses. The buttons are btPedra[0], btPedra[1], btPedra[2], btPedra[3] . If the...
asked by 12.06.2015 / 05:00
3
answers

Equal Distribution Logic

I wanted to know if anyone knows of an even distribution algorithm. For example I have 10 spaces and I have 4 a, 2 b, 3 c, 1 d. And I have to distribute these variables into these 10 positions equally so that they are even, without repeating the...
asked by 26.02.2014 / 13:19
1
answer

Search for isolated components in graph

What will be the best algorithm to find isolated components in a graph? That is, components that do not lose information. Inthisimage,theonlycomponentisolatedisH,becauseitonlyreceives"information".     
asked by 04.03.2014 / 04:56