Fork me on GitHub
上一页 1 2 3 4 5 6 7 8 9 ··· 16 下一页
摘要: /** * 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]. * * 给定一组数字,返回所有可能 阅读全文
posted @ 2019-08-08 11:47 gentleKay 阅读(208) 评论(0) 推荐(0) 编辑
摘要: /** * Given a sorted linked list, delete all duplicates such that each element appear only once. * For example, * Given1->1->2, return1->2. * Given1->1->2->3->3, return1->2->3. * * 给定一个已排序的链接列表,删除所有重复 阅读全文
posted @ 2019-08-08 11:47 gentleKay 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 参考资料:https://blog.csdn.net/snow_7/article/details/51815787 阅读全文
posted @ 2019-08-07 15:33 gentleKay 阅读(145) 评论(0) 推荐(0) 编辑
摘要: /** * Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. * click to show follow up. * Follow up: * Did you use extra space? * A straight forward solution u... 阅读全文
posted @ 2019-08-07 10:22 gentleKay 阅读(155) 评论(0) 推荐(0) 编辑
摘要: /** * 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"two 1 s"or21. * 21is read off as"one ... 阅读全文
posted @ 2019-08-07 10:21 gentleKay 阅读(218) 评论(0) 推荐(0) 编辑
摘要: /** * * @author gentleKay * Given an array of non-negative integers, you are initially positioned at the first index of the array. * Each element in t 阅读全文
posted @ 2019-08-06 10:54 gentleKay 阅读(123) 评论(0) 推荐(0) 编辑
摘要: /** * * @author gentleKay * Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is 阅读全文
posted @ 2019-08-06 10:53 gentleKay 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Queue是java中实现队列的接口,它总共只有6个方法,我们一般只用其中3个就可以了。Queue的实现类有LinkedList和PriorityQueue。最常用的实现类是LinkedList。 压入元素(添加):add()、offer() 相同:未超出容量,从队尾压入元素,返回压入的那个元素。区 阅读全文
posted @ 2019-08-05 15:22 gentleKay 阅读(304) 评论(0) 推荐(0) 编辑
摘要: StackDemo: 阅读全文
posted @ 2019-08-05 15:18 gentleKay 阅读(114) 评论(0) 推荐(0) 编辑
摘要: /** * * @author gentleKay * Given a linked list, swap every two adjacent nodes and return its head. * For example, * Given1->2->3->4, you should retur 阅读全文
posted @ 2019-08-05 10:49 gentleKay 阅读(169) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 16 下一页