Questions tagged as 'algoritmos'

1
answer

Calculate tan-1 in angles c #?

I'm trying to do the following calculation but nothing works for me The calculation of tan-1(1) the result of the calculator is 45 grados but I can not obtain this result in C #. Code: Math.Tanh(1);// resultado = 0,...
asked by 12.10.2018 / 05:42
1
answer

Problems with C libraries

I have this library to perform different validations in my project #ifndef VALIDACION_H #define VALIDACION_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ncurses.h> #include <ctype.h> #inc...
asked by 01.12.2016 / 21:07
2
answers

group tuples of a list [closed]

I am interested in grouping tuples of two elements of a list of tuples that share an element. How could I do this in python? For example, if I have the list [(1,2),(2,5),(3,4),(4,1),(8,2)] the answer should be [[(1,2),(2,5),(8,2)],[...
asked by 28.11.2018 / 16:26
1
answer

Problem with the use of python classes

When I run my program it gives me this error:    new = colony.Colonia (self .__ tasks, self .__ times)   UnboundLocalError: local variable 'colony' referenced before assignment my class is the following: import tareas import hormiga imp...
asked by 30.01.2018 / 20:35
3
answers

Does anyone explain to me what the trace makes the Fibonacci code recursive in Java?

Good morning. I am trying to draw the trace that follows this recursive fibonacci Java code to see exactly how recursivity works in this case. I do not quite understand the exact operation in this particular case since in the return it is assume...
asked by 01.03.2017 / 16:26
3
answers

Can you help me find the error? repetitive cycle for C ++

I have to print the average of the approved grades and the average of the approved grades but I get it wrong. Does anyone have any suggestions? #include<stdio.h> #include<stdlib.h> #include<conio.h> int main () { int...
asked by 30.06.2017 / 00:00
2
answers

What is the error of this algorithm? [closed]

I would like to see if you could help me find the error in this algorithm, the exercise says to calculate the discount: if m> = 300 the discount is 25% - if 150
asked by 23.06.2017 / 18:34
3
answers

Operators + = and / = with while in Python

I am starting to study Python through an online course. Although I have worked in R for a couple of years, and in general, I think the programming has many similar bases, there are notable differences. One of the most obvious ones I have...
asked by 23.08.2017 / 20:49
1
answer

Modify node in C

I have this function to modify a node, but when I use it, it modifies the node I asked for but deletes the others. How can I change it and not delete the other nodes? _nodoActividades *modificarActividades(_nodoActividades *apuntador) {...
asked by 02.12.2016 / 07:23
1
answer

Determine if a matrix can be divided into two such that it has the same number of special characters

The following code seeks to determine if an array of size N, composed of "." and "#" can be split in two, such that the number of characters "#" in each piece is the same. The partition must be done horizontally or vertically, it can not be diag...
asked by 08.10.2018 / 03:53