87,29,15 (38) a. b. 9,12,15 c. 24,12,15 d. 24,20,15
Excuse me:
1. Among the first number is 24, is after 15 out of 29 56, 69, 87, and the rest of the series
9 to 12 in the 15 to 20 which is the middle number
2. Why the answer is not C D
CodePudding user response:
Used deductionFirst median 24 after comparison, the rest of the series is 9 15 20, 12 comparison obviously only c is in accordance with,
CodePudding user response:
The middle number is the array length len/2, is divided into three areas, the entire array [0 ~ len/2), len/2, (len/2 ~ n - 1) and then in turn determineIf the key==a len/2, return success
If keyIf key> A len/2, for processing (len/2, n - 1]
The second median, 4/2 is 2 is [9,12,15), 15 (15, 20]