# Questions tagged as 'algoritmo'

3

## Rotate matrix in 90º

I need to create an algorithm in C to rotate a 10x10 matrix by 90 degrees, though I can not use an auxiliary array for that. Simplifying what was asked to try to find some pattern and use it to solve the problem I used a 3x3 array and compare...
asked by 24.08.2015 / 15:53
2

## Search by tree depth

I would like to develop an algorithm that does the depth search in a binary tree, but I am not getting it. When we make the tree we assign to each node the cost (cost to move from one node to the other) and the heuristic (heuristic value of e...
asked by 09.06.2015 / 19:28
3

## Counter of a subsequence of strings repeated in C

Consider a string composed of several subsequences.    For example: cccaaaabbbbxdddddddddaaannn. The smallest substring is the letter x, with only one element; the largest subsequence is that of letter d, with 9 elements. Make an algorith...
asked by 01.11.2018 / 21:18
1

## Algorithm for cutting plane

I do not know if this is the best place to ask this question, but I searched a lot on the internet for some algorithm for cutting plan - which, by informing the dimensions of the pieces, shows the best arrangement so that it is minimized as litt...
asked by 04.08.2014 / 19:53
3

## Algorithm with structure PARA and SE

An algorithm that reads the name and gender of fifty-six people and gives the name and whether it is a man or a woman. In the end, report the total number of men and women. I need the program to run in VisualG. I made this code but it is not...
asked by 30.09.2015 / 01:47
1

## Why does String hashCode () in Java use 31 as a multiplier?

In Java, the hash code for an object String is computed as s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] using integer arithmetic, where s[i] is the i -th character of the string, n is the length of the string,...
asked by 02.01.2019 / 17:54
1

## How to execute a loop while waiting for input?

I want to know if you can execute a loopback while waiting for an input () input, and immediately after receiving the input the for loop or while starts processing she immediately. something like: imputs = [] parar = false def faca_algo...
asked by 31.12.2016 / 13:42
1

## Segmentation fault: branch and bound in c

I'm having a persistent error in my code. My goal is to find the path in a maze mounted on an array with an algorithm of type branch and bound . Here is the code: FILE *ent; FILE *saida; int NL; int temp; char c; struct labirintos{ int **...
asked by 24.02.2015 / 02:52
1