Created
October 25, 2015 01:56
-
-
Save gcrfelix/8551ecbac026a900c2de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
给两个sorted array, 返回它们两个包含的相同元素,比如[2, 3, 4], [1, 2, 3, 5] 返回[2, 3] | |
然后追加的是如果其中一个array特别长一个比较短怎么做 | |
解法: | |
对短数组里的每个元素在长数组里进行二分查找 当然,二分查找的空间也是逐步缩小的,虽然算法复杂度不会变 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment