Skip to main content

All Questions

4 votes
1 answer
218 views

probability of number of comparisons of randomized quicksort

Let's assume we have an array of length $5$ which contains pairwise different integers. The subcript denotes the order of the respective integer, so $i_1<i_2<i_3<i_4<i_5$. We apply the ...
Philipp's user avatar
  • 4,564
0 votes
1 answer
68 views

Why is the probability of two elements being compared equal to 2/(𝑗−𝑖+1) in random quicksort?

After reading Why is the probability of two elements $y_i$, $y_j$ being compared equal to $2/(j - i + 1)$ in random quicksort? I am confused as to what $j-i+1$ means in the denominator. Is it the ...
mathguy's user avatar
  • 927
1 vote
1 answer
278 views

Randomized Quick Sort and Partition Probability?

We know about Quick Sort and Randomized Version and Partition. I ran into a Fact when I read my notes. Let $0 < a < 0.5$ be some constant. We have an $n$-element array as input. Randomized ...
LoveMathContest's user avatar