275 H-Index II
Follow up for H-Index: What if the citations
array is sorted in ascending order? Could you optimize your algorithm?
思路
接上一题,按顺序排列,方法更为简洁。一趟遍历即可解决。
P.S. 更可以用二分查找法。
|
|
Follow up for H-Index: What if the citations
array is sorted in ascending order? Could you optimize your algorithm?
接上一题,按顺序排列,方法更为简洁。一趟遍历即可解决。
P.S. 更可以用二分查找法。
|
|