Question DSA-SORT-0022
EasyWhich sorting algorithm repeatedly swaps neighbouring elements that are in the wrong order?
- A.
Heap sort
- B.
Merge sort
- C.
Show answer and explanation
Answer: C
Large elements 'bubble' to the end, one pass at a time.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Sorting question
Which sorting algorithm repeatedly swaps neighbouring elements that are in the wrong order?
Heap sort
Merge sort
Answer: C
Large elements 'bubble' to the end, one pass at a time.
Bubble sort
Quick sort