Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 229 Bytes

File metadata and controls

5 lines (3 loc) · 229 Bytes

数组下标计算:

(pos1 + pos2) / 2 = 中间元素的pos,若个数为偶数,则为第一个中间数;

(size + 1) / 2 = 若个数为偶数,值为左右元素个数,若个数为奇数,则左边元素多一个数;