Bubble sort algorithm takes O(n2) time to sort the given array. A modified bubble sort is implemented with an extra flag. If the list is already sorted, then the extra flag is used to skip the remaining passes. What is best case complexity of the above modified bubble sort?

1
O(n)
2
O(log n)
3
O(n2)
4
None of the above

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation