随笔分类 -  [LeetCode 题解]

LeetCode 个人的题解,加一些愚见~欢迎探讨
摘要:前言 【LeetCode 题解】系列传送门: " http://www.cnblogs.com/double win/category/573499.html " 题目链接 "54. Spiral Matrix" 题目描述 Given a matrix of m x n elements (m ro 阅读全文
posted @ 2017-12-05 00:05 Double_win 阅读(224) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: " http://www.cnblogs.com/double win/category/573499.html " 题目描述 Suppose an array sorted in ascending order is rotated at some p 阅读全文
posted @ 2017-12-03 20:23 Double_win 阅读(183) 评论(0) 推荐(0) 编辑
摘要:链表在笔试面试中都是出镜率极高的一种数据结构。 由于链表具有结构简单,代码量较少,变化多,可以较为全面的考察应聘者的逻辑思考能力以及应变能力的特点,而备受面试官青睐。 在本节中,我将Leetcode中链表相关的题目即解决思路列举一下,希望对大家有所帮助。 按照LeetCode添加题目的时间可以看到链 阅读全文
posted @ 2017-05-26 12:21 Double_win 阅读(989) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 2. 题意 寻找两个链表的交点。 提示: 1. 如果两个链表没有交集,那么返回NULL。 2. 链表的结果不能发生变化。 3. 两 阅读全文
posted @ 2014-11-27 22:29 Double_win 阅读(218) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Say you have an array for which the ith element is th... 阅读全文
posted @ 2014-11-27 19:35 Double_win 阅读(191) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all th... 阅读全文
posted @ 2014-11-25 16:27 Double_win 阅读(212) 评论(0) 推荐(0) 编辑
摘要:[Leetcode 题解]:Palindrome Number 阅读全文
posted @ 2014-09-30 15:44 Double_win 阅读(457) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given a linked list, swap ever... 阅读全文
posted @ 2014-08-27 15:51 Double_win 阅读(204) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given a set of candidate numbers (C) and a target numb... 阅读全文
posted @ 2014-08-08 17:59 Double_win 阅读(248) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given a linked list, reverse the nodes of a linked li... 阅读全文
posted @ 2014-08-06 23:17 Double_win 阅读(196) 评论(0) 推荐(0) 编辑
摘要:二叉树的先序遍历,采用递归以及非递归方式 阅读全文
posted @ 2014-08-06 21:40 Double_win 阅读(315) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given a binary tree, check whether it is a mirror ... 阅读全文
posted @ 2014-08-04 23:04 Double_win 阅读(171) 评论(0) 推荐(0) 编辑
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?题意:... 阅读全文
posted @ 2014-08-02 20:32 Double_win 阅读(283) 评论(0) 推荐(0) 编辑
摘要:Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.题意:翻转... 阅读全文
posted @ 2014-08-01 00:44 Double_win 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi... 阅读全文
posted @ 2014-07-31 23:41 Double_win 阅读(245) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文
posted @ 2014-07-31 13:37 Double_win 阅读(541) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文
posted @ 2014-07-29 12:57 Double_win 阅读(424) 评论(0) 推荐(0) 编辑
摘要:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题意:给定一个有序的链表,将其转换成平衡二叉搜索树思路: 二分法要构建一个平衡二叉... 阅读全文
posted @ 2014-07-29 10:43 Double_win 阅读(438) 评论(0) 推荐(0) 编辑
摘要:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2014-07-28 21:11 Double_win 阅读(488) 评论(0) 推荐(0) 编辑
摘要:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.题意:对k个有序的链表进行归并排序。并分析其复杂度。/** * Definition for singly-... 阅读全文
posted @ 2014-07-28 20:44 Double_win 阅读(529) 评论(0) 推荐(0) 编辑