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...
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...
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...
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...
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...
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,...
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...
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 **...
Having, for example, the following instructions:
int i=10, j=20;
int *pti, *ptj;
pti = &i;
ptj = &j;
What is the meaning of
j = pti == ptj;
and
i = pti || ptj;
?
In addition, I've read that summing the subtraction b...
The question is quite simple, I would like to know how the System.Random class generates random pseudorandom numbers from a seed, which I think is rather strange. I know they are not totally random, and so I have my doubt as to how they a...