ReasoningHardIBPS PO Mains · SBI PO Mains · SSC CGL Tier 2

Input–output: A machine rearranges a line of words. In each step the machine scans the line once from left to right, comparing each pair of neighbouring words, and swaps the two words whenever the left word comes after the right word in dictionary order (the scan continues with the swapped arrangement). A scan in which no swap is needed is not counted as a step, and the machine stops. Input: bridge violet mango mountain castle umbrella. How many steps are needed to complete the arrangement of this input?

  1. A. 5
  2. B. 4
  3. C. 2
  4. D. 3

Correct answer: D. 3

Applying the rule step by step: Step I: bridge mango mountain castle umbrella violet; Step II: bridge mango castle mountain umbrella violet; Step III: bridge castle mango mountain umbrella violet. The last step changing anything is Step III, so 3 steps are needed.

हिंदी में

इनपुट-आउटपुट: एक मशीन शब्दों की एक पंक्ति को पुनर्व्यवस्थित करती है। प्रत्येक चरण में मशीन पंक्ति को बाएँ से दाएँ एक बार देखती है, हर पास-पास के शब्दों के जोड़े की तुलना करती है, और जब भी बायाँ शब्द शब्दकोश क्रम में दाएँ शब्द के बाद आता है तो दोनों शब्दों की अदला-बदली कर देती है (जाँच बदली हुई व्यवस्था के साथ आगे बढ़ती है)। जिस जाँच में किसी अदला-बदली की आवश्यकता नहीं होती उसे चरण नहीं गिना जाता और मशीन रुक जाती है। इनपुट: bridge violet mango mountain castle umbrella। इस इनपुट की व्यवस्था पूरी करने के लिए कितने चरणों की आवश्यकता होगी?

  1. A. 5
  2. B. 4
  3. C. 2
  4. D. 3

उत्तर: D. नियम को चरण-दर-चरण लगाने पर: चरण I: bridge mango mountain castle umbrella violet; चरण II: bridge mango castle mountain umbrella violet; चरण III: bridge castle mango mountain umbrella violet। अंतिम बदलाव वाला चरण III है, इसलिए 3 चरण आवश्यक हैं।

More Data Sufficiency and Input–Output questions

Exams that ask this topic