-->
当前位置:首页 > 题库

Let $$a = (a_1, a_2, \ldots, a_i, \ldots, a_j, \ldots, a_n)$$ de

Luz5年前 (2021-05-10)题库1762
Let $$a = (a_1, a_2, \ldots, a_i, \ldots, a_j, \ldots, a_n)$$ denote the list of elements we want to sort. In the quicksort algorithm, if the pivot is selected uniformly at random. Then any two elements get compared at most once and the probability of $$a_i$$ and $$a_j$$ being compared is $$2/(j-i+1)$$ for $$j > i$$, given that $$a_i$$ or $$a_j$$ is selected as the pivot. ~@[](2)

答案:FALSE