wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Max writes some numbers as input and commands a robot to arrange them in descending order. The robot arranges the numbers in three steps and delivers the output as given:

Input: 25 40 36 49 18
Step 1: 49 25 40 36 18
Step 2: 49 40 25 36 18
Step 3: 49 40 36 25 18

Similarly, find in how many steps the robot will be able to deliver the output if the input is given as below:
Input : 72 89 3 13 29 42

A
Five
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Two
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Three
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Four
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D Four
From the given input–output, we can see that the robot arranges one number in each step.

Similarly, for the new input, the number of steps taken are:

Input: 72 89 3 13 29 42
Step 1: 89 72 3 13 29 42
Step 2: 89 72 42 3 13 29
Step 3: 89 72 42 29 3 13
Step 4: 89 72 42 29 13 3

Thus, the input will be arranged in descending order in four steps.

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Calendar Calculations
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon