answersLogoWhite

0

double max(const arr[], int arrSize)
{
double maximum = arr[0];
for (int j = 0; j < arrSize; j++)
{
if (maximum < arr[j])
{
maximum = arr[j];

}

}

return maximum;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is the maximum number of comparisons required in a binary search algorithm to find a specific element in a sorted array?

The maximum number of comparisons required in a binary search algorithm to find a specific element in a sorted array is log(n), where n is the number of elements in the array.


How to find max and min values?

Find the minimum and maximum of what? An array?


What is the most efficient way to find the maximum value in a sliding window of a given array?

One efficient way to find the maximum value in a sliding window of a given array is to use a data structure like a deque (double-ended queue) to store the indices of elements in the window. By iterating through the array and maintaining the maximum value within the window, you can update the deque to ensure that it only contains relevant indices. This approach allows you to find the maximum value in the sliding window with a time complexity of O(n), where n is the number of elements in the array.


Write a c program to find the maximum value of 25 element in an array?

int findMax(int *array) { int max = array[0]; for(int i = 1; i &lt; array.length(); i++) { if(array[i] &gt; max) max = array[i] } return max; }


What is the process to find the median of an array of numbers?

To find the median of an array of numbers, first, arrange the numbers in ascending order. If the array has an odd number of elements, the median is the middle number. If the array has an even number of elements, the median is the average of the two middle numbers.


Write a c program to find the maximum of two numbers and print out with its position?

maxValue = function (array) {mxm = array[0];for (i=0; i&lt;array.length; i++) {if (array[i]&gt;mxm) {mxm = array[i];}}return mxm;}; i don't know


What is the maximum number of entries that can be placed in the chained hash table?

The maximum number of entries that can be placed in a chained hash table is determined by the size of the underlying array used for storage. Each bucket in the array can hold multiple entries due to chaining, so the total number of entries that can be stored is dependent on the size of the array and the hashing function used.


How can you find the length of a single dimensional array in BlueJ?

array.length will return the number of elements in array.


What is the process for finding the kth smallest number in an unsorted array?

To find the kth smallest number in an unsorted array, you can use a sorting algorithm like quicksort or heapsort to arrange the array in ascending order. Then, you can simply access the kth element in the sorted array to find the kth smallest number. This process ensures that the kth smallest number is easily identified and retrieved from the array.


How can you get position of number from given some number by using array in c language?

Traverse the array from index 0 until you find the number. Return the index of that number.


Program to print all the even numbers of an array in visual basic?

find even number in array


How will making an array help someone find factors in a number?

The numbers of rows and columns in a rectangular array form a factor pair for that number.