English

A list has 12 elements. How many passes will a bubble sort algorithm make to sort the list? -

Advertisements
Advertisements

Question

A list has 12 elements. How many passes will a bubble sort algorithm make to sort the list?

Options

  • 12

  • 11

  • 6

  • 7

MCQ

Solution

11

Explanation:

To sort the list, n-1 passes are made, so for 12 elements, there will be 11 passes.

shaalaa.com
Bubble Sort
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×