how many sorts will the bubble sort algorithm do to sort the following array? (6, 3,1,4,2,5)
Answers
Answered by
2
Answer:
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. Example: First Pass: ( 5 1 4 2 8 ) –> ( 1 5 4 2 8 ), Here, algorithm compares the first two elements, and swaps since 5 > 1.
Explanation:
Similar questions
Math,
2 months ago
Math,
2 months ago
Biology,
2 months ago
Social Sciences,
6 months ago
Math,
6 months ago
Computer Science,
11 months ago
Science,
11 months ago
Social Sciences,
11 months ago