How can I count the number of comparisons and changes in Shell Sort? Where to properly use the counters?
void ShellSort(int vetor[], int n)
{
int i , j , val, comp=0, swap=0;
int gap = 1;
while(gap < n) {
gap = 3*gap+1;...
I can not understand what is wrong with this code, I was supposed to press s1 once and m1 to stay connected but it turns off after a while. The program also does not count as it should.
The question is this:
In the system below when a par...
People need help in this exercise. I did the whole exercise and it runs fine only in the end it gives error because of passing the array address to the function.
What's the problem here? Suppose I have to pass the address of the array, make a...
I need to make a program that:
Get the pc model, the price of it and display the highest value, plus the number of computers without peripherals.
In the main function, receive the amount of peripherals.
A function that receives as a para...
/* define a struct TAD lista */
struct lista {
float info; /* dado */
struct lista *prox; /* ponteiro para o proximo elemento */
};
typedef struct lista Lista;
I have the struct above. and the following int main
int main(i...
I looked up and found some proposed calculations for the contrast modification of an image but I could not understand it straight.
Could anyone give me an algorithm to modify the contrast of an easy-to-understand image without conversion to H...
I have a function that comes from a .lib that returns me a struct
tabela GSTV(vector<double> inpA, vector<double> inpB);
This struct is defined as follows:
struct tabela {
vector<int> Z;
vector<double> F;...