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
The maximum number of elements will depend on the type of array and the available memory. An array of char requires only 1 byte per element but an array of pointers requires 4 bytes per element (8 bytes on 64-bit systems). Arrays of objects or structures would likely require more memory per element.For all practical purposes, the maximum size is 2,147,483,647 elements, which is the maximum positive range for a 4-byte integer (0x7FFFFFFF). At 1 byte per element, that works out at 2GB.
sparse array is one which has contents lower than its maximum size, that is the array has free or empty locations....
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?
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
A square array is an array in which the number of rows is the same as the number of columns.