Understanding “median of medians” algorithm
I want to understand "median of medians" algorithm on the following example: We have 45 distinct numbers divided into 9 group with 5 elements each. 48 43 38 33 28 23 18 13 8 49 44 39 34 29 24 19 14 9 50 45 40 35 30 25 20 15 10 51 46 41 36 31 26 21 16 53 52 47 42 37 32 27 22 17 54 The first step is sorting every group (in this case they are already sorted) Second step recursively, find the "true" median of the medians ( 50 45 40 35 30 25 20 15 10 ) i.e. the set will be divided into 2 groups: 50 25 45 20 40 15 35 10 30 sorting these 2 groups 30 10 35 15 40 20 45 25 50 the medians is 40 and 15 (in