Questions tagged as 'algoritmo'

2
answers

Program that adds / multiplies 2 numbers and what is between them and prints

I think the logic of this program is right, but the result is going wrong. Make a program that receives two numbers X and Y, where X < Y. Calculate and show: the sum of the even numbers of this range of numbers, including the numbers ente...
asked by 17.09.2015 / 21:03
1
answer

You can access the key by:

In dictionaries, in Python, is it possible to access a key through the value? Is there any method that invert key / value?     
asked by 29.04.2016 / 19:08
1
answer

Problem in language C, question with prime numbers

I'm solving exercises, in C language, on vectors. The exercise is as follows: Make an algorithm that uses a menu with the following options: order a vector of 5 increasing positions, order a vector of 5 decreasing positions and store in a vector...
asked by 01.08.2016 / 00:32
1
answer

avoid stackoverflow while reading and popular relations

I'm doing a library that populates a random model with random values, to be used in tests, but it happens that when I have a relation like below, I get a StackOverflowException Author @Entity public class Author implements Serializ...
asked by 29.07.2015 / 00:15
2
answers

Algorithm with flowchart / diagram

Well, I'm taking a course in logic and the following question fell:    Develop a block diagram to check which products need to be purchased and the quantity to be purchased: Having the following information:       Product code (CODPRO), Mi...
asked by 09.12.2017 / 00:31
1
answer

Loop "for" counted odd number, even and averaging

I need to make a code that: List a number of numbers Inform if they are divisible by 3 and 5 If they are even or odd And then take the separate mean of each (average of odd and average pairs) I made a code, but when it does the aver...
asked by 03.10.2017 / 04:23
2
answers

Algorithm simulation of taximeter

I am creating a Javascript algorithm to do the calculation similar to a tick meter, where you have the time for the flag 1 and the flag 2 . function test(hora,bandeira1, bandeira2) { if (hora >= bandeira1 && hora < bandeira2...
asked by 19.10.2017 / 04:59
1
answer

Binary tree level walking

Description of the problem I need to solve: "A path per level in a tree, first list the root, then all nodes that are at level 1 then all nodes of level 2, etc. Write a procedure to list the nodes of a binary tree by level." As it is necessar...
asked by 04.05.2016 / 04:17
2
answers

Word problem with same letters

I'm solving a problem where I get a array of strings with different words, I have to find out for each word ( string ) which are your friends. Friendly words are those that have the same letters in different or equal order. The proble...
asked by 02.08.2016 / 17:44
1
answer

Is there an insertion method for a binary search tree that is faster than the trivial one?

I'm trying to solve this problem in a judge online. The problem provides N integers that must be inserted, in the given order, into an algorithm for inserting a binary search tree. Then Q queries are performed. For each query the code s...
asked by 12.07.2016 / 21:04