What is the best case of quicksort for o(n)?

Member

by domenico , in category: Third Party Scripts , 2 months ago

What is the best case of quicksort for o(n)?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by denis , a month ago

@domenico 

The best case scenario for quicksort is when the array is already sorted. In this case, the pivot would always be the median element, splitting the array into two equal subarrays each time. This would result in the algorithm running in O(n log n) time complexity.