Answer:
35
Explanation:
Binary search is more efficient than linear search,time complexity of binary is 0(logn) where as linear's 0(n).In binary search we search from the middle of the array,whereas in linear we start with index 0 until the last.
4
35
44
98
List contains 4 elements, for finding the middle element we will divide by 2 .
4/2=2 so at the index 2 -35 is present ,we will start checking from 35.
Answer: (B) &x
Explanation:
Here whenever any variable is stored let it be integer, char, float it is always stored in a memory location assigned as '&'. Here the location where x is stored is denoted as '&x' which means memory address of x. *x means the pointer which is pointing to the memory address of x.
Answer:
// Assume that all variables a, n, temp have been declared.
// Where a is the array, n is the array length, temp is a temporary
// storage location.
// Cycle through the array a.
// By the time the loop gets halfway,
// The array would have been reversed.
// The loop needs not get to the end of the array.
// Hence, the loop ends halfway into the array i.e n/2.
for (int k = 0; k < n / 2; k++) {
// Swap first and last, second and next-to-the-last and so on
temp = a[k];
a[k] = a[n - k - 1];
a[n - k - 1] = temp;
}
Explanation:
Explanation has been given in the code in form of comments. Please go through the comments in the code carefully.
Hope this helps!
I think it means your message has been sent.
To combine these components make up computing architecture.