+1 vote
in Data Structures & Algorithms I by (110k points)
What will be the minimum number of jumps required to reach the end of the array arr[] ={0,1,3,6,3,6,8,5}?

(a) 1

(b) 2

(c) 3

(d) not possible to reach the end

The above asked question is from Number of Jumps to Reach End-array Operation in chapter Arrays Types of Data Structures & Algorithms I

This question was posed to me in an interview for internship.

1 Answer

+1 vote
by (408k points)
selected by
Best answer
Right answer is (d) not possible to reach the end

Easy explanation - Each element of the array represents the maximum number of steps that can be taken forward from that element. So as the first element here is 0 so we cannot move any further from the first element. Thus, it is not possible to reach the end of the array.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.