answersLogoWhite

0

9, the elements are: arr[0], arr[1], ... arr[9]

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is the sie of an array whos upper bound is 100?

To calculate the size of array the type of array should be given. Ex: if it is of integer type that means int arr[100] and integer is of 4 bytes, then the size of array will be 400 bytes.


Write an algorithm for quick sort?

#include <stdio.h> #include <stdlib.h> #define size 50 void swap(int *x,int *y) { int temp; temp = *x; *x = *y; *y = temp; } int partition(int i,int j ) { return((i+j) /2); } void quicksort(int list[],int m,int n) { int key,i,j,k; if( m < n) { k = partition(m,n); swap(&list[m],&list[k]); key = list[m]; i = m+1; j = n; while(i <= j) { while((i <= n) && (list[i] <= key)) i++; while((j >= m) && (list[j] > key)) j--; if( i < j) swap(&list[i],&list[j]); } // swap two elements swap(&list[m],&list[j]); // recursively sort the lesser list quicksort(list,m,j-1); quicksort(list,j+1,n); } } void printlist(int list[],int n) { int i; for(i=0;i<n;i++) printf("%d\t",list[i]); } void main() { int n,i; int list[size]; printf("How many numbers do you want to enter"); scanf("%d",&n); printf("Enter the numbers you want to sort"); for(i=0;i<n;i++) { scanf("%d",&list[i]); } printf("The list before sorting is:\n"); printlist(list,n); // sort the list using quicksort quicksort(list,0,n-1); // print the result printf("The list after sorting using quicksort algorithm:\n"); printlist(list,n); }


Algorithm of linear search in c?

int linearSearch(int a[], int first, int last, int key) { // function: // Searches a[first]..a[last] for key. // returns: index of the matching element if it finds key, // otherwise -1. // parameters: // a in array of (possibly unsorted) values. // first, last in lower and upper subscript bounds // key in value to search for. // returns: // index of key, or -1 if key is not in the array. for (int i=first; i<=last; i++) { if (key == a[i]) { return i; } } return -1; // failed to find key }


How do declare function pointer having two integer parameters and returning integer pointers?

// declare a function int* function(int, int); or int* (function)(int, int); // declare a pointer to a function int* (*pointer_to_function)(int, int);


Get size of int using sizeoff?

printf ("sizeof (int) = %d\n", (int)sizeof (int));

Related Questions

17.7 to 1dp lower and upper bound?

Lower bound is 17.6 and upper bound is 17.8


What is an example of a function that is continuous and bounded on the interval a b but does not attain its upper bound?

A function whose upper bound would have attained its upper limit at a bound. For example, f(x) = x - a whose domain is a < x < b The upper bound is upper bound is b - a but, because x < b, the bound is never actually attained.


What are the lower bound estimate and the upper bound estimate found by rounding to the greatest place 937 and ndash 156 A. lower bound 700 upper bound 800 B. lower bound 700 upper bound 900 C. lower?

The answer is B.


What is the upper bound estimate?

An upper bound estimate is a estimate that is greater than the actual solution.


How do you define the least upper bound of a subset?

Let (B, ≤) be a partially ordered set and let C ⊂ B. An upper bound for C is an element b Є Bsuch that c ≤ b for each c Є C. If m is an upper bound for C, and if m ≤ b for each upper bound b of C, then m is a least upper bound of C. C can only have one least upper bound, and it may not have any at all (depending on B). The least upper bound of a set C is often written as lub C.See related links for more information.


What is the upper bound of 21.4?

The upper bound of a number is the smallest value that is greater than or equal to that number. For 21.4, the upper bound can be considered as 21.5, since it is the next decimal value that exceeds 21.4. However, in a more general context, any number greater than 21.4 can also serve as an upper bound.


What is the connection between Theta and Big-O notation?

Big O gives an upper bound whereas big theta gives both an upper bound and a lower bound.


What is the upper bound of an array whose size is 100?

The upper bound is the size minus 1 since VB starts with zero not one.


WHAT IS THE UPPER BOUND OF 4.46 TO 2 DP?

4.46 is a fixed number: it has no upper nor lower bound. To 2 dp it is 4.46


What is the upper and lower bound of 6800?

The upper bound of a number is the smallest whole number that is greater than or equal to the given number. In this case, the upper bound of 6800 is 6800 itself. The lower bound of a number is the largest whole number that is less than or equal to the given number. Therefore, the lower bound of 6800 is also 6800.


How do you calculate the lower and upper bounds if each of the numbers is given to the nearest whole number?

The lower bound is 0.5 less and the upper bound is 0.5 more.


What is the sie of an array whos upper bound is 100?

To calculate the size of array the type of array should be given. Ex: if it is of integer type that means int arr[100] and integer is of 4 bytes, then the size of array will be 400 bytes.