Boostable

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  LeetCode

LeetCode解题报告。
摘要:LeetCode: Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree. For example:G... 阅读全文
posted @ 2014-08-25 21:27 Boostable 阅读(153) 评论(0) 推荐(0)

摘要:LeetCode: Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A... 阅读全文
posted @ 2014-08-25 21:10 Boostable 阅读(148) 评论(0) 推荐(0)

摘要:LeetCode: Word LadderGiven two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such th... 阅读全文
posted @ 2014-08-24 20:07 Boostable 阅读(287) 评论(0) 推荐(0)

摘要:LeetCode: Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,G... 阅读全文
posted @ 2014-08-24 19:37 Boostable 阅读(285) 评论(0) 推荐(0)

摘要:LeetCode: Sum Root to Leaf NumbersGiven a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is t... 阅读全文
posted @ 2014-08-24 19:27 Boostable 阅读(229) 评论(0) 推荐(0)

摘要:LeetCode: Surrounded RegionsGiven a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's i... 阅读全文
posted @ 2014-08-24 19:15 Boostable 阅读(200) 评论(0) 推荐(0)

摘要:LeetCode: Palindrome PartitionGiven a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome ... 阅读全文
posted @ 2014-08-24 18:56 Boostable 阅读(342) 评论(0) 推荐(0)

摘要:LeetCode: Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serializatio... 阅读全文
posted @ 2014-08-23 19:11 Boostable 阅读(195) 评论(0) 推荐(0)

摘要:LeetCode: Gas StationThere are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited ... 阅读全文
posted @ 2014-08-23 18:36 Boostable 阅读(286) 评论(0) 推荐(0)

摘要:LeetCode: CandyThere are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to th... 阅读全文
posted @ 2014-08-23 13:57 Boostable 阅读(203) 评论(0) 推荐(0)

摘要:LeetCode: Single NumberGiven an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a... 阅读全文
posted @ 2014-08-23 11:56 Boostable 阅读(201) 评论(0) 推荐(0)

摘要:LeetCode: Copy List with Random PointerA linked list is given such that each node contains an additional random pointer which could point to any node ... 阅读全文
posted @ 2014-08-23 11:29 Boostable 阅读(227) 评论(0) 推荐(0)

摘要:LeetCode: Word BreakGiven a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more di... 阅读全文
posted @ 2014-08-22 22:17 Boostable 阅读(303) 评论(0) 推荐(0)

摘要:LeetCode: Linked List CycleGiven a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space?地址:https://oj.... 阅读全文
posted @ 2014-08-22 21:59 Boostable 阅读(344) 评论(0) 推荐(0)

摘要:LeetCode: Reorder List Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering ... 阅读全文
posted @ 2014-08-01 10:21 Boostable 阅读(268) 评论(0) 推荐(0)

摘要:LeetCode: Binary Tree Traversal题目:树的先序和后序。后序地址:https://oj.leetcode.com/problems/binary-tree-postorder-traversal/先序地址:https://oj.leetcode.com/problems/... 阅读全文
posted @ 2014-08-01 10:03 Boostable 阅读(226) 评论(0) 推荐(0)

摘要:LeetCode: LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.... 阅读全文
posted @ 2014-07-28 22:36 Boostable 阅读(377) 评论(0) 推荐(0)

摘要:LeetCode: Insertion Sort ListSort a linked list using insertion sort.地址:https://oj.leetcode.com/problems/insertion-sort-list/算法:按题目的意思,采用插入排序对链表进行排序,时... 阅读全文
posted @ 2014-07-28 22:19 Boostable 阅读(203) 评论(0) 推荐(0)

摘要:LeetCode: Sort ListSort a linked list in O(n log n) time using constant space complexity.地址:https://oj.leetcode.com/problems/sort-list/算法:采用分治的思想,首先利用... 阅读全文
posted @ 2014-07-28 22:16 Boostable 阅读(216) 评论(0) 推荐(0)

摘要:LeetCode: Max Points on a LineGiven n points on a 2D plane, find the maximum number of points that lie on the same straight line.地址:https://oj.leetcod... 阅读全文
posted @ 2014-07-27 21:58 Boostable 阅读(288) 评论(0) 推荐(0)