Questions tagged as 'algoritmo'

1
answer

Calculating hours

I need to calculate the exact time that a certain record has to be analyzed. Each record has a range where it can be parsed, and a maximum value in hours for term p> Example Endtime=Dateregistration+Term=12/26/201404:24:31ButIneedt...
asked by 29.12.2014 / 03:33
1
answer

Input bugando without reason

I've done a program that computes (by a DB itself using fstream ) patients from a hospital. It has output functions (one for ostream using iomanip and one for ofstream and fstream ) and input ( get() ). As a requi...
asked by 03.05.2014 / 03:10
1
answer

Converting a .NET algorithm to JS

Friends, I have a small problem in 'converting' an algorithm. In the algorithm in .net I have the following conditional structure: if (')' == caracter){ String item = pilha.Pop().ToString(); while (!item.Equals("(")){ re...
asked by 05.12.2014 / 14:53
0
answers

Monte Carlo methods in C ++

This is the code I created to calculate in C ++ using Monte Carlo methods, the average distance between the points evenly distributed in a cube. I do not understand why in the output file "distance_media_when_to_the_number_of_configurations.txt"...
asked by 28.10.2018 / 03:21
2
answers

Function that checks if a vector is in ascending order

I'm doing an exercise that says:    Critique the code for the following function, which promises to decide whether the vector   v [0..n-1] is in ascending order. int verifica (int v[], int n) { //n é o tamanho do vetor if (n > 1)...
asked by 06.10.2018 / 03:36
0
answers

Help with bicubic interpolation algorithm

I'm trying to implement the bicubic interpolation algorithm but I'm having a lot of difficulty with interpolated values (it's not related to taking the values of the original matrix, but the relationship of the weights of distances). Followin...
asked by 09.01.2018 / 01:25
1
answer

Doubt about filling a two-dimensional array in Java

I'm doing an exercise and I need help. Here is the statement:    Calculate the average temperatures of each month. To do this, create a list containing the names of each month in the rows, and the number of days of each month in the columns....
asked by 10.07.2016 / 03:09
1
answer

What happens to the variable i in this algorithm? Sequence inversion algorithm

Good evening. I began to study data structure with the support of the book Data Structure and Their 2nd Algorithms (SZWARCFITER / MARKENZON). The first algorithm of the book tries to invert the elements of the sequence in the vector, changing...
asked by 16.06.2016 / 23:40
0
answers

Philosophers' Dinner in Python [closed]

I wonder if anyone has already implemented the Philosopher's Dinner algorithm in python. I need to do it, however I only find examples with implementation using thread and I need to do it without using thread.     
asked by 29.03.2015 / 00:32
2
answers

Mysterious Square

   The whole numbers positioned in a square NxN such that all lines and main diagonal have the same sum.       For example, the square below 2 7 11 9 5 6 4 3 13       is a mysterious square of sum 20, since all lines (2 + 7 + 11 = 20, 9 +...
asked by 03.07.2018 / 06:34