![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode解题
文章平均质量分 52
zbwustc
这个作者很懒,什么都没留下…
展开
-
【LeetCode】max-points-on-a-line一条线上最多点
题干Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 在一个2D平面中,找到点集中在一条直线上最多的有多少个点。数据结构 * Definition for a point. * struct Point { * int x; *原创 2017-04-12 17:16:57 · 834 阅读 · 0 评论 -
【LeetCode】binary-tree-level-order-traversal i&ii&zigzag
题干binary-tree-level-order-traversalGiven a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example: Given binary tree{3,9,20,#,#,15,7},原创 2017-05-18 10:31:22 · 246 阅读 · 0 评论 -
【LeetCode】triangle & pascals-triangle i&ii
题干triangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4],原创 2017-05-08 15:47:20 · 241 阅读 · 0 评论 -
【LeetCode】convert-sorted-link-to-binary-search-tree & convert-sorted-array-to-binary-search-tree
题干convert-sorted-link-to-binary-search-treeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.convert-sorted-array-to-binary-search-treeGiven a原创 2017-05-16 17:01:34 · 213 阅读 · 0 评论 -
【LeetCode】partition-list
题干partition-listGiven a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes原创 2017-05-26 16:24:16 · 244 阅读 · 0 评论 -
【LeetCode】path-sum i&ii
题干path-sum iGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree a原创 2017-05-11 10:49:52 · 238 阅读 · 0 评论 -
【LeetCode】binary-tree-postorder-traversal
题干Given a binary tree, return the postorder traversal of its nodes’ values. For example: Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1]. Note: Recursive solution is trivi原创 2017-04-17 14:50:37 · 236 阅读 · 0 评论 -
【LeetCode】populating-next-roght-pointers-in-each-node i&ii
题干populating-next-roght-pointers-in-each-nodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next po原创 2017-05-10 10:22:25 · 232 阅读 · 0 评论 -
【LeetCode】linked-list-cycle-ii
题干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?链表是否有环?如果有找到环的入口结点。 是否可以不开辟额外空间。数据结构/** * Defi原创 2017-04-20 09:48:03 · 240 阅读 · 0 评论 -
【LeetCode】palindrome-partitioning i&ii
题干palindrome-partitioning iGiven a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s =”aab”, Return原创 2017-05-02 14:26:04 · 308 阅读 · 0 评论 -
【LeetCode】recorder-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 the nodes’ values. For example, Given{1,2,3,4}, reorder it to{1,4,原创 2017-04-19 20:28:43 · 347 阅读 · 0 评论 -
【转】 字符串的全排列和组合算法
字符串的全排列和组合算法标签: 算法permutationstringiterator面试2012-04-15 11:24 83004人阅读 评论(39)收藏举报本文章已收录于:分类: 面试珠玑(84) 作者同类文章X版权声明:本文为博主原创文章,未经博主允许不得转载。全转载 2017-06-12 14:29:00 · 373 阅读 · 0 评论