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
2 votes
1 answer
182 views

Sit N people around a table so as to minimize the maximum difference in height between any two adjacent people

(This is actually a coding challenge for an interview. Unfortunately, only 2 test cases are coded, so even if my solution passes them both, that doesn't tell me I've found the correct solution. Also, ...
Enlico's user avatar
  • 315
2 votes
2 answers
202 views

Could graph theory aid in the understanding of comparison sorting algorithms?

I am interested in computing the exact number of comparisons that are needed to sort a list. See this wikipedia article. Up to $n=15$, we know how many comparisons between elements one must make to ...
Max Muller's user avatar
  • 7,148