Questions tagged as 'algoritmos'

2
answers

C # - How to convert keyboard string data to Char?

Good community! I am new to the C # Language and I am doing a program where 3 phenotypes are created (ie 3 vectors, each size 4) where 2 are father and mother, of these 2 the child has to be generated (the 3rd vector) , the user will have to...
asked by 28.04.2017 / 03:41
2
answers

Java. Improve iteration speed

   Example       For a = [2, 3, 3, 1, 5, 2] , the output should be    firstDuplicate(a) = 3 .       There are 2 duplicates: numbers 2 and 3 . The second occurrence of 3   has a lower rate than the second occurre...
asked by 27.11.2017 / 03:05
1
answer

Run Backtracking algorithm

First of all, during all this time ago I have been using this model to solve my problems with backtracking. It's a backtraking model made by my university link . private void bt() { if(estado.isFinal()){...
asked by 30.05.2017 / 15:09
8
answers

How to build a unique number based on several numbers

Good morning, to explain better what I want to know is to let you know so I can use it. With a class called Personaje I want to know how it is dressed, it would be enough to create several variables where a number is stored that identi...
asked by 19.07.2017 / 23:49
1
answer

How to add a matrix n x n using threads (Thread)?

I want to know how to add a square matrix n x n using java threads and I did it with a fixed matrix of 2 x 2 but I can not think of doing it with a matrix of n x n. //Clase Suma public class Suma extends Thread { private int n1; private int...
asked by 23.12.2016 / 22:50
1
answer

Is there any other way to make a Bubble Sort without defining it?

In Python3, when you search how to make a bubble sort, find something like this def bubbleSort(alist): for passnum in range(len(alist)-1,0,-1): for i in range(passnum): if alist[i]>alist[i+1]: temp =...
asked by 31.07.2018 / 19:26
1
answer

When sorting an array removes data

I am programming a genetic algortimo so that this solves problems of linear programming, I am using C language, when calculating the limit of the variables I keep the values in a float type array, I need to order that array but it erases a data...
asked by 22.04.2018 / 20:42
1
answer

Go through 2 positions per iteration FOR

Good, our first for runs 16 positions in this case and we want that both padre as punto have the same value for each 2 positions (That is, for i=0 and i=1 the same value, for i=2 and i=3 other ....)....
asked by 15.08.2017 / 20:52
1
answer

How to solve a combinatorial problem, preferably in python?

Today I come to pose a problem, more of algorithm than of language. I need to get to generate one, several, or all the possible combinations of 25 elements, (or I would even be satisfied with at least one combination with as many elements as pos...
asked by 31.05.2017 / 18:44
1
answer

Doubts about complexity bfs

In some texts (many), where the algorithm BFS is explained (Search in width - < em> Breadth First Search ) is a section that says that the complexity of this is O(v+e) , or failing O(v2) . That is, a problem P, but in some AI texts...
asked by 18.06.2016 / 00:19