0% found this document useful (0 votes)
76 views

Cópia de Sorting Algorithms - Mind Map

Quicksort is a divide-and-conquer algorithm that works by choosing a pivot element and partitioning the array around it such that elements less than the pivot come before and elements greater than the pivot come after. It recursively sorts the subarrays on each side of the pivot. Quicksort has an average time complexity of O(n log n) and worst case of O(n^2), making it one of the fastest sorting algorithms on average but sensitive to input data.

Uploaded by

Artur Santos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

Cópia de Sorting Algorithms - Mind Map

Quicksort is a divide-and-conquer algorithm that works by choosing a pivot element and partitioning the array around it such that elements less than the pivot come before and elements greater than the pivot come after. It recursively sorts the subarrays on each side of the pivot. Quicksort has an average time complexity of O(n log n) and worst case of O(n^2), making it one of the fastest sorting algorithms on average but sensitive to input data.

Uploaded by

Artur Santos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

DIVIDE-AND-

CONQUER

DIVIDE-AND-CONQUER

QUICKSORT

Choose a Pivot (say, at the


first postion of the array). Order of Growth in Order of Growth in
Best Case Θ(n log n) Average Case Θ(1.39n
log n)

Take two references, one Order of Growth in


at the beginning (after the Worst Case Θ(n²)

pivot) and one at the end

Quicksort makes only 39%


more comparisons in the It is not stable
average case compared to
The left one (i), will increase The right one (j), will
the best case
its position untill the decrease its position untill
It requires a stack to
element in the position is the element in the position
Its innermost loop is so store parameters of
higher than the pivot is lower than the pivot efficient that it usually subarrays that are yet
runs faster than merge
to be sorted
and heapsort
Then, they exchange their
This process goes until the Sensitive to the
values, the pivot goes to the There are improvements
middle and the function gets initial position is in a that can cut the computer architecture
recalled with half of the array higher index than the end algorithm's running time and data type
by 20%-30%

Artur Carvalho dos Santos - acs9@cin.ufpe.br

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy