- 博客(11)
- 资源 (6)
- 收藏
- 关注
原创 LeetCode题解:Subsets II
Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate
2015-09-06 21:32:54 645
原创 LeetCode题解:Subsets
Given a set of distinct integers, nums, return all possible subsets.Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets. For example, If
2015-09-06 21:30:11 485
原创 LeetCode题解: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
2015-09-06 21:28:13 436
原创 LeetCode题解:Group Anagrams
Given an array of strings, group anagrams together.For example, given: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”], Return:[ [“ate”, “eat”,”tea”], [“nat”,”tan”], [“bat”] ] Note: For the re
2015-09-06 21:24:27 1304
原创 LeetCode题解:Permutations
Given a collection of numbers, return all possible permutations.For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].题意:求出给定数字的所有组合可能解决思路:先加入
2015-09-06 21:14:25 430
原创 LeetCode题解: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 order of O(log n).If the target is not found in the ar
2015-09-06 21:07:40 427
原创 LeetCode题解:Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible orde
2015-09-06 21:03:15 542
原创 LeetCode题解:Divide Two Integers
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.题意:不使用乘,除,模符号作除法运算解决思路:每一个数都可以用2进制表示,利用这一点通过位运算完成代码:public class Solution { public int
2015-09-06 20:58:18 994
原创 LeetCode题解:Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You may no
2015-09-06 20:55:30 490
原创 LeetCode题解:Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.题意:给定一棵树的先序遍历和中序遍历,还原该树解决思路:在中序遍历中,每一个根节点的左方为其左子树,右方为右子树;而在先序遍历中
2015-09-06 20:52:08 509
原创 一个由内存泄漏引发的血案-Square
一个内存泄漏引发的血案-Square 原文链接 : A small leak will sink a great ship 原文作者 : Pierre-Yves Ricau 译文出自 : 开发技术前线 www.devtf.cn。未经允许,不得转载! 译者 : chaossss 校对者: 这里校对者的github用户名 状态 : 完成 在开发 LeakCa
2015-09-05 09:56:32 3671 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人