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 endAsked question is from Number of Jumps to Reach End-array Operation topic in division Arrays Types of Data Structures & Algorithms IThe question was posed to me in an interview for job.

Answer»

Correct answer is (d) not possible to reach the END

Best explanation: Each element of the ARRAY represents the maximum NUMBER of steps that can be taken forward from that element. So we cannot move any further after reaching the second element HENCE it is impossible to reach the end of the array.



Discussion

No Comment Found

Related InterviewSolutions