上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页
摘要: 先走k-1步,然后判断fast有没有到空为止. 阅读全文
posted @ 2019-06-23 19:04 王爷爱吃秋刀鱼 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://leetcode-cn.com/problems/top-k-frequent-elements/ 解题思路: 多了一个hashmap的排序 阅读全文
posted @ 2019-06-19 21:42 王爷爱吃秋刀鱼 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 解题思路: 乘着做这个题,顺便复习下堆排序。 先说堆排序是一个什么东西:https://blog.csdn.net/u013384984/article/details/79496052 大顶堆升序,小顶堆降序。 随便定义的一个堆。 第一步: 此时我们从最后一个非叶子结点开始(叶结点自然不用调整,第 阅读全文
posted @ 2019-06-19 20:55 王爷爱吃秋刀鱼 阅读(325) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problemset/top-interview-questions/ 阅读全文
posted @ 2019-06-09 13:03 王爷爱吃秋刀鱼 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode.com/problems/intersection-of-two-linked-lists/ 解题思路: 两个链表的公共节点,首先让长的链表先走length1-length2步,然后一起走 阅读全文
posted @ 2019-06-04 23:41 王爷爱吃秋刀鱼 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode.com/problems/same-tree/ 解题思路: 死鬼,如果p和q为空,那就相等。如果有一个为空,一个不为空,那就不等。然后两个值相等,那就递归判断下去。 阅读全文
posted @ 2019-06-04 23:20 王爷爱吃秋刀鱼 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode.com/problems/reverse-linked-list-ii/ 解题思路: 阅读全文
posted @ 2019-06-04 23:02 王爷爱吃秋刀鱼 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode.com/problems/binary-tree-inorder-traversal/ 解题思路: 二叉树的中序遍历。 阅读全文
posted @ 2019-06-04 22:59 王爷爱吃秋刀鱼 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode.com/problems/word-search/ 解题思路: 这个题目和剑指offer上的路径问题是一样的,今天再次复习一下写法。 阅读全文
posted @ 2019-06-03 20:22 王爷爱吃秋刀鱼 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://leetcode.com/problems/subsets/ 78: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The soluti 阅读全文
posted @ 2019-06-01 12:29 王爷爱吃秋刀鱼 阅读(322) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页