childIDs 数组
cid 要插入的对象
int index = Collections.binarySearch(childIDs, cid);
if (index < 0) {
childIDs.insertElementAt(cid, (index + 1) * -1);
stack.push(cid);
}
Collections.binarySearch
时间: 2024-12-07 05:39:31
childIDs 数组
cid 要插入的对象
int index = Collections.binarySearch(childIDs, cid);
if (index < 0) {
childIDs.insertElementAt(cid, (index + 1) * -1);
stack.push(cid);
}
Collections.binarySearch