The worst-case is when the input is sorted or sorted in reverse order, and the algorithm takes time O(n2) for this case.
What is the expression used to denote a worst case complexity as expressed by time taken?
O(n2)