# 50+ Number of Jumps to Reach End-array Operation MCQs

We have the best collection of the Number of Jumps to Reach End-array Operation MCQs and answer with FREE PDF. These Number of Jumps to Reach End-array Operation MCQs will help you to prepare for any competitive exams like: BCA, MCA, GATE, GRE, IES, PSC, UGC NET, DOEACC Exams at all levels – you just have to practice regularly.

## Number of Jumps to Reach End-array Operation MCQs

#### 1. What will be the minimum number of jumps required to reach the end of the array arr[] = {1,2,0,0,3,6,8,5}?

a) 1

b) 2

c) 3

d) not possible to reach the end

Answer: not possible to reach the end

a) true

b) false

a) 1

b) 2

c) 3

d) 4

#### 4. What will be the worst case time complexity of the following code?

``````#include <bits/stdc++.h>
using namespace std;

void func(int arr[], int n)
{
int count[n];
memset(count, 0, sizeof(count));

for (int i=n-2; i>=0; i--)
{
if (arr[i] >= n - i - 1)
count[i]++;

for (int j=i+1; j < n-1 && j <= arr[i] + i; j++)

if (count[j] != -1)
count[i] += count[j];

if (count[i] == 0)
count[i] = -1;
}

for (int i=0; i<n; i++)
cout << count[i] << " ";
}

int main()
{
int arr[] = {1, 3, 5, 8, 9};
int n = sizeof(arr) / sizeof(arr[0]);
func(arr, n);
return 0;
}
``````

a) O(n1/2)

b) O(n)

c) O(n3/2)

d) O(n2)

a) true

b) false

a) O(n)

b) O(n2)

c) O(n3/2)

d) O (1)

#### 7. What will be the minimum number of jumps required to reach the end of the array arr[] = {1,3,6,3,6,8,5}?

a) 1

b) 2

c) 3

d) not possible to reach the end