创新写作

LintCode问题图解-33

2017-11-12  本文已影响1人  billliu_0d62

本文准备讲解1个简单的算法编程问题, 这个算法编程问题来自LintCode平台。不了解.LintCode平台的读者可以阅读笔者文章(在线编程平台推荐-LeetCode)。问题的英文版本描述如下:

Position

For a sorted array and a target, return the target index. 

Example

[1,3,5,6], 5 → 2

[1,3,5,6], 2 → 1

[1,3,5,6], 7 → 4

[1,3,5,6], 0 → 0

介绍1种简单高效的算法。

简单高效的算法
上一篇 下一篇

猜你喜欢

热点阅读