2013年10月12日

Search for a Range

摘要: Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord... 阅读全文

posted @ 2013-10-12 14:08 Step-BY-Step 阅读(152) 评论(0) 推荐(0) 编辑

Search Insert Position

摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Here are few examples.[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 public class So 阅读全文

posted @ 2013-10-12 12:55 Step-BY-Step 阅读(142) 评论(0) 推荐(0) 编辑

Count and Say

摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文

posted @ 2013-10-12 12:51 Step-BY-Step 阅读(237) 评论(0) 推荐(0) 编辑

导航