Questions tagged as 'algoritmo'

1
answer

Generating unique identifier using time () [closed]

I've created an algorithm to generate a handle, which consists of a random value with 24 non-sequential characters. The goal is basically to capture the current time using time() and concatenate it with musical notes (letters 'a' to 'g')....
asked by 11.12.2016 / 18:14
1
answer

How to transform a while structure in for? And vice versa? [closed]

I'm needing an explanation on how to transform a structure in while to for and vice versa. Thanks in advance for any help!     
asked by 28.04.2016 / 04:02
1
answer

Sum of numbers smaller than n that are multiples of 3 or 5

I need to write a program that receives input n and prints the sum of all numbers smaller than n and that are multiples of 3 or 5. For this, I should only use the while-repeat structure and no data type as a set or list, as it is an exercise...
asked by 19.03.2016 / 13:11
2
answers

Sum of Useful Days

Is there any way to add business days to a date that does not use repeat loops (such as while and for)? I currently use this code var novaData = new Date(dataBase.valueOf()); var diasUteisRemanescente; var isFimDeSemana; var direcao; // R...
asked by 04.02.2016 / 11:04
2
answers

Make two items in a ListView switch position

I am creating a button called upload, to make an item in the listview go up, while the one that was above goes down. But I've tried everything and it will not, I do not know if I'm wrong in logic. But I tried to do it in two ways. The first (...
asked by 07.02.2014 / 14:23
1
answer

Problem with the calculation of the average in C language

I'm doing this exercise:    4 - Write an algorithm that reads a set of 50 tokens each   containing the height and sex of a person (1 = male and 2 =   feminine), and calculate and print:       The highest and lowest height of the class;  ...
asked by 26.10.2018 / 19:26
2
answers

Larger number of occurrences of an element in an array of objects - JavaScript

Hello, I have an array of news (objects) lista: Array<Noticia> = []; From this array I need to find out the author who most published the news. One news item has: ID | Title | Tags Author | Content . My initial idea was:...
asked by 17.09.2018 / 18:20
1
answer

Factorial function does not return

I need to use function in C but it is not returning the factorial.    Problem: "Given an integer n, compute its factorial n !.   factorial of a number is given by the equation: n! = n(n
asked by 20.09.2018 / 15:04
1
answer

Number of co-occurrences in a matrix

I have a more mathematical rather than a computational doubt. We assume that we have a square matrix M of dimension n² , where n is any integer greater than zero. By traversing this array, assigning j as row index and i...
asked by 03.08.2018 / 02:02
1
answer

Recursive Heapsort in C

I have a heapsort, and would like to implement it recursively. What do I need to change in my algorithm? void criarHeap(int v[], int inicio, int final){ int aux = v[inicio];//v[pai]//inicio=pai int filho = (inicio * 2)+1;//i=filho whil...
asked by 05.08.2018 / 18:39