摘要:
使用二分查找的序列必须是有序的。 时间复杂度O(logn),每次当前序列长度的一半。 1. 递归实现 /** * To search if the target is in a given array. If find, return the position of * the target in 阅读全文
摘要:
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp 阅读全文