摘要: 题目: The code base version is an integer start from 1 to n. One day, someone committed a bad version in the code case, so it caused this version and th 阅读全文
posted @ 2017-05-07 20:15 Vincent丶丶 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 i 阅读全文
posted @ 2017-05-07 16:09 Vincent丶丶 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 模板:(通用模板,推荐) 给定一个排序的整数数组(升序)和一个要查找的整数target,用O(logn)的时间查找到target第一次出现的下标(从0开始),如果target不存在于数组中,返回-1。 若将条件改为查找target最后一次出现的下标(从0开始),那么程序将发生改变,循环中如果 arr 阅读全文
posted @ 2017-05-07 13:03 Vincent丶丶 阅读(1400) 评论(0) 推荐(0) 编辑
摘要: 题目: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, determi 阅读全文
posted @ 2017-05-06 20:38 Vincent丶丶 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: 题解: 之前解过Next Permut 阅读全文
posted @ 2017-04-26 08:59 Vincent丶丶 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 题目: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not po 阅读全文
posted @ 2017-04-24 22:19 Vincent丶丶 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 题目: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 阅读全文
posted @ 2017-04-24 21:06 Vincent丶丶 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目: Remove all elements from a linked list of integers that have value val. Example 题解: 这道题没什么好讲的,基础操作。需要注意的是链表的第一个node,因为没有前驱节点,所以该node需要特殊处理,会导致额外的代 阅读全文
posted @ 2017-04-24 20:47 Vincent丶丶 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, 阅读全文
posted @ 2017-04-23 13:40 Vincent丶丶 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra spac 阅读全文
posted @ 2017-04-23 12:49 Vincent丶丶 阅读(160) 评论(0) 推荐(0) 编辑