摘要:
在A[0..n-1]中,满足条件 A[i]==i的索引。给定一个有序数组,设法找到其中的magic index。扩展:考虑有重复元素的情况如何处理。public class Solution { public static int magicIndex(int[] array) { ... 阅读全文
摘要:
Related leetcode questions: BST: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/ BT, node always in the tree. https://le 阅读全文