1.

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 endThe above asked question is from Number of Jumps to Reach End-array Operation in chapter Arrays Types of Data Structures & Algorithms IThis question was posed to me in an interview for internship.

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.



Discussion

No Comment Found

Related InterviewSolutions