- 博客(4)
- 收藏
- 关注
原创 LeetCode——Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fi
2017-09-25 11:04:31 92
原创 LeetCode——Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1] ha
2017-09-21 11:33:31 125
原创 LeetCode--Swap Nodes in Pairs
本题的题意就是给定一个链表,然后链表中的节点为相邻两个一组,调换他们,最后返回到链表的头部。还要注意的是不可以去修改列表中的值,只有节点本身可以改变。 本题的思路有很多,我来介绍两种思路: 第一种思路就是一种搜索的思路,就是递归的方法去一直调用sawpPairs函数。直到传进swapPairs函数的参数的节点为空节点(当前的参数节点为最后一个节点且节点总数为偶数)或者参数节点的下一个节点为空(
2017-09-16 12:50:55 233
原创 LeetCode--Permutations 全排列
Given a collection of distinct 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], [3,2
2017-09-10 23:22:47 136
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人