Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 1 : 34, 25, 12, 22, 11, 64, 90

Advertisement

Detailed Solution

सही उत्तर 34, 25, 12, 22, 11, 64, 90 है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

What is the state of the array [64, 34, 25, 12, 22, 11, 90] after the first pass of bubble sort in ascending order? / आरोही क्रम में बबल सॉर्ट के पहले पास के बाद ऐरे [64, 34, 25, 12, 22, 11, 90] की स्थिति क्या होगी?

1.
34, 25, 12, 22, 11, 64, 90
2.
11, 34, 25, 12, 22, 64, 90
3.
64, 34, 25, 12, 22, 11, 90
4.
11, 12, 22, 25, 34, 64, 90

Correct Answer: 34, 25, 12, 22, 11, 64, 90

One bubble-sort pass swaps each adjacent out-of-order pair, pushing the largest element 90 to the end: [34, 25, 12, 22, 11, 64, 90]. The smallest element reaches the front only in selection sort, not bubble sort. / बबल सॉर्ट का एक पास प्रत्येक क्रम-विरुद्ध आसन्न युग्म को अदल-बदल करता है, जिससे सबसे बड़ा एलिमेंट 90 अंत में पहुँचता है: [34, 25, 12, 22, 11, 64, 90]। सबसे छोटा एलिमेंट सिलेक्शन सॉर्ट में सामने आता है, बबल सॉर्ट में नहीं।

Downloaded from PrepSnap (prepsnap.in)