4,540 views

2 Answers

Best answer
2 votes
2 votes
First iteration of Outer loop ---------------> n-1 comparisions

Second iteration of Outer loop ----------> n-2 comparisions (Since  largest element has gone to its proper place)

Third iteration of Outer loop--------------->n-3 comparisions (Since two largest elements has gone to their proper places)

Total number of comparisions  =  (n-1)+(n-2)+(n-3)+............+1 = n(n-1) / 2 = O(n^2)

Option D.
selected by
Answer:

Related questions

1 votes
1 votes
2 answers
1
makhdoom ghaya asked Aug 21, 2016
2,917 views
Web Mining is not used in which of the following areas ?Information filteringCrime fighting on the internetOnline transaction processingClick stream analysis.
1 votes
1 votes
1 answer
3
1 votes
1 votes
0 answers
4