in Technology by

There is a one line error in the following routine. Find that line.

		1.	int Max(int a[], int n)
		2.	{
		3.		  int mi, i;
		4.		  for (mi = 0, i = 0; i < n; i++)
		5.		  if (a[i] > a[mi])
		6.		  mi = i;
		7.		  return mi;
		8.	}

1 Answer

0 votes
by

Answer: b
Explanation: The increment condition in the for loop declaration is incorrect. We should use ++i instead of i++.

Related questions

0 votes
    There is one small error in the following flip routine. Find out which line it is on. void flip(int arr[], int i) 2 { 3 int t, ... 12 } a) Line 3 b) Line 5 c) Line 7 d) Line 9...
asked Dec 28, 2022 by JackTerrance
0 votes
    When we realize a specific implementation of a pancake algorithm, every move when we find the greatest of the ... b) Exponential functions c) Logarithmic functions d) Permutations...
asked Dec 29, 2022 in Technology by JackTerrance
0 votes
    Pancake Sorting appears in which of the following? a) Frequency Scaling b) Storage Virtualization c) Parallel Processing d) Neural Networking...
asked Dec 28, 2022 in Technology by JackTerrance
0 votes
    In a computational complexity theory, a problem with decision making is said to be NP-complete when it is both ... c) Non-deterministic Polynomial time d) Non Probabilistic time...
asked Dec 29, 2022 in Technology by JackTerrance
0 votes
    How many flips does the simplest of pancake sorting techniques require? a) 3n−3 flips b) 2n-4 flips c) 2n-3 flips d) 3n-2 flips...
asked Dec 28, 2022 in Technology by JackTerrance
0 votes
    Which operation is most essential to the process of pancake sort? a) Flip the given data b) Find the largest of ... least of given data d) Inserting something into the given data...
asked Dec 28, 2022 in Technology by JackTerrance
0 votes
    What is the time complexity for a given pancake sort given it undergoes “n” flip operations? a) O(n) b) O(n2) c) O(n3) d) O(2n)...
asked Dec 28, 2022 in Technology by JackTerrance
0 votes
    Suppose that while writing the R code that consists of multiple functions. While executing the code, there is an error ... you use to find the function that is facing problem?...
asked Oct 16, 2020 in Technology by JackTerrance
0 votes
    Which of the following model model include a backwards elimination feature selection routine? (a) MCV (b) MARS (c) MCRS (d) All of the mentioned...
asked Oct 7, 2021 in Technology by JackTerrance
0 votes
    Which of the following model model include a backwards elimination feature selection routine? (a) MCV (b) MARS ... and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    Which is the duplication of computer operations and routine backups to combat any unforeseen problems: (a) ... part 5 topic in chapter Transactions of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    If there are two children in a family. Find the probability that there is at least one girl child in the family. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    If there are two children in a family, find the probability that there is at least one boy in the family. Select the correct answer from above options...
asked Nov 22, 2021 in Education by JackTerrance
0 votes
0 votes
    Ten eggs are drawn successively with replacement from a lot containing 10% defective eggs. Find the probability that ... defective egg. Select the correct answer from above options...
asked Nov 13, 2021 in Education by JackTerrance
...