CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon


Question

How many steps will be required to get the final output from the following input?

Input: 31 88 162 447 375 72 29


  1. Two

  2. Three

  3. Four

  4. Six

  5. None of these


Solution

The correct option is E

None of these


From the last step, it is clear that there are two alternating series of numbers: One in descending order and the other in ascending order. When we go through:

Input to step 1, we find that the largest no. becomes the first and remaining numbers shift rightward. In the next step the smallest no. becomes the second and the rest shift rightward. These two steps continue alternately until the two alternate series are formed.

flag
 Suggest corrections
thumbs-up
 
0 Upvotes


Similar questions
View More


People also searched for
View More



footer-image