use*_*073 4 algorithm
说我有数组
{0, 1, 2, 3, 4}
要么
{0, 1, 2, 3, 4, 5}
我记得看到过一种非常聪明的方法。就像是
i%array.length
bea*_*ker 5
试试这个:
oppIndex = array.length - firstIndex - 1;
归档时间:
12 年,3 月 前
查看次数:
779 次
最近记录: