Answer:
Answer D : Low is 4 and high is 6
Explanation:
Here is Function
int binarySearch(int arr[], int l, int r, int x) {
while (l <= r) {
int m = l + (r - l) / 2;
// Check if x is present at mid
if (arr[m] == x)
return m;
// If x greater, ignore left half
if (arr[m] < x)
l = m + 1;
// If x is smaller, ignore right half
else
r = m - 1; }
// if we reach here, then element was
// not present
return -1; }
Answer:
B) (x<=1)
Explanation:
Though this code given will run perfectly without any requirement of base case.But still we have to include a base case I will suggest (x<=1) because the value of x is decreased by one at each recursive call so it can handle it very well and it can handle negative values of x also if user enters it by mistake since factorial is for positive numbers only.
Answer: much faster than average (11% or higher)
Explanation:
The two components which is used to provide input to the computer is Keyboard and mouse. These two are most used input devices. Keyboard provides all the alphabet and numbering inputs and apart from these kinds of data, it also has certain function key, keys to edit text. Mouse has 3 main functions.
Every operation is done through the click of the mouse. Either we may double click to open up a file, right click and use scroll to scroll the pages. There are other inputs like joy stick which is used for game and used majorly in play stations.