Question DSA-SORT-0025
EasyWhat is [5, 1, 4, 2, 8] after the first pass of bubble sort (ascending)?
- A.
[1, 5, 4, 2, 8]
- B.
[1, 4, 2, 5, 8]
- C.
[1, 2, 4, 5, 8]
- D.
[5, 4, 2, 1, 8]
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Sorting question
What is [5, 1, 4, 2, 8] after the first pass of bubble sort (ascending)?
[1, 5, 4, 2, 8]
[1, 4, 2, 5, 8]
[1, 2, 4, 5, 8]
[5, 4, 2, 1, 8]
Sign up free to see the answer and a step-by-step explanation.