What is the worst-case time complexity of QuickSort when the pivot is always the smallest or largest element?