class maximum
{
public static void main(string...args)
{
System.out.println(max(new int[]{5,3,6,2,4,61}));
}
static int max(int[]a)
{
int max=0;
for(int i=0;i
if(a[i]>max)
max=a[i];
}
return max;
}
}
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.
int findMax(int *array) { int max = array[0]; for(int i = 1; i < array.length(); i++) { if(array[i] > max) max = array[i] } return max; }
maxValue = function (array) {mxm = array[0];for (i=0; i<array.length; i++) {if (array[i]>mxm) {mxm = array[i];}}return mxm;}; i don't know
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.
1
One dimensional array creates the number array which has 50 components, each capable of holding one integer value . in other words the number array has a total of 50 components . all of type integer
It depends on the size of the array. If you defined the array as 10 x 20 x 30 x 40... int a[10][20][30][40]; ...then the maximum element (coefficient?) number would be 9,19,29,39... int b = a[9][19][29][39];
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
sparse array is one which has contents lower than its maximum size, that is the array has free or empty locations....
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;}
write a division sentence modeled by an array that has 2 more rows than the number in each row
int max(int arr[], int arrSize){int maximum = arr[0];for (int i = 0; i < arrSize; i++){if (maximum < arr[i]){maximum = arr;}}return maximum;}