best case means, already array is in sorted order, so if it is in sorted order then only one time max() function will be executed where we are checking largest value only once with n-1 comparisons. after first iteration of outer for loop we will get to know that its already sorted. so no of comparisons will be just n-1. for best case and worst case no of swapping will remain same as 3(n-1).