Questions tagged as 'algoritmos'

1
answer

Doubt with the algorithm of the hannoi tower according to wikipedia

I know it's a somewhat absurd question, but I would like to know about the fragment that appears in wikipedia, link , which is 1 on the line: si origen == {1} entonces     
asked by 25.06.2017 / 14:22
1
answer

Generate a table of codes from Huffman's Tree

given a tree of the type: data THuffman = Hoja Char | Nodo THuffman THuffman and with the data type type TablaCodigo = [(Char,String)] I must create a function extraerCodigos :: THuffman -> TablaCodigo That I generate a table o...
asked by 04.05.2017 / 04:06
2
answers

How to take the first letter inside a String in Javascript if the first character is a number?

For example    12kghggdhfj74ghg8hgh From the string I should take the 12 and the k but the text can change can be    127rnbvcx And from there I should take the 127 and the r and save it in each variable...
asked by 05.10.2017 / 01:17
2
answers

I need help to formulate a prime number algorithm

How is the algorithm that I have to write for a whole list of numbers save the first n ° cousin entered?     
asked by 21.05.2017 / 19:20
1
answer

List linked in C

First I create the list, then I check if it is empty or not, then I pass the values that I want the list to have, but when I print the lists I do not get the values that I passed on to them. How do I print what I'm going through? struct alumno...
asked by 20.11.2016 / 03:27
1
answer

Mix in a list common and non-common numbers within the interval marked by the first list [duplicated]

Good morning, I have reconsidered the question I have a list:    [- 0.5, -0.4, -0.1, 0, 1.0, 2.0, 3.0, 2.0, 1.0, 0, -0.2, -0.3 -0.5] and another list:    [- 0.3, -0.1, 0, 1.2, 2.0, 2.3, 2.0, 1.5, 0, -0.1, -0.3 -0.5] the final...
asked by 10.01.2017 / 11:49
1
answer

What is the error in this algorithm? (C ++)

This algorithm must order 4 numbers and print them in an ascending way, I did this, compare them with each other, but with the n3 and n4 I do not do well, because it can be? I was looking for the error but I can not find it, if anyone can give m...
asked by 24.06.2017 / 23:35
3
answers

Add naturals to "n" [closed]

I want to implement a def suma_naturales_hasta(n) function. For this I could use a for loop that would go through the number that I entered, that is, if I put 3, that the sum is 1 + 2 + 3. How could I implement this for...
asked by 07.11.2017 / 21:06