Table of Contents
Det er en meget hurtig brug af sortin ved det er effektivt. Understand er det ydeevne involverer analysis analyse af dette forventede antal af komparative og swaps under ledelse af ledelse. Det er artikel explorer disse principper er en hindring for disse forventninger, fokuseret på denne sandsynlighedsanalyse af quicksort.
Forventede tal for sammenligning
Dette forventede antal af sammenlignelige produkter afhænger af, om de er repræsentative for dette valg af produkt og for de pågældende partitioni-oner.
1; 1; FLT: 0; 3; C (n) = n - 1 + frac {1} {n} sum _ {k = 0} {n - 1}
Disse recurrence er en god idé resultat: 1; FLT: 3; C (n) n n n n n (1); FLT: 1; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 3; FLT: 4; FIT: 4; FIT: 3; FIT: 3; FIT: 3; FIT: 4; FIT: 4; FIT: 3; 4; 4; 4; 4; 4; 4; 4; 4; 4; 4; 5; 5; 5; 5; 5; 5; 5; 5; 5; 5; 5; 5; 5; 5; 5; 6; 6; 6; 6; 6; 6; 6; 6; 6; 6;
Forventede antal swaps
Det forventede antal swaps er related to the number of the number of the comparisons and the Distribution Of Pivot Choices. Unde uniforme randomics, The expected swaps, denoted as connected 1; FLT: 0; S (n); S (n); FLT: 1; FLT: 1; DY; 3; Can be approximated by analyzing the partis.
Each partition step involverer swapping elements to ensure correct sted på denne pivot. Denne forventelige swaps pr partition ar ar proportional to the size ofthe subarrays. Summing over all recursive calls youledd an approximato: Note 1; FLT: 0; S (n) Yacht n n n n; FLT: 1; FLT: 1; 3;
Resumé af Kommissionens forslag
- (1); (1); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3).
- (1); (1); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3); (3).
- Both metrics grow logaritmically with array size, reflekting Quicksort 's effektivitetcy.