![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
文章平均质量分 73
Siren0413
这个作者很懒,什么都没留下…
展开
-
Merge Sorted Array
Merge Sorted Array Total Accepted: 6782 Total Submissions: 21148My SubmissionsGiven two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A h原创 2014-02-01 02:53:42 · 430 阅读 · 0 评论 -
Construct Binary Tree from Preorder and Inorder Traversal
Construct Binary Tree from Preorder and Inorder Traversal Total Accepted: 4148 Total Submissions: 16533My SubmissionsGiven preorder and inorder traversal of a tree, construct the binary原创 2014-01-30 05:19:12 · 457 阅读 · 0 评论 -
Construct Binary Tree from Inorder and Postorder Traversal
Construct Binary Tree from Inorder and Postorder Traversal Total Accepted: 3984 Total Submissions: 15858My SubmissionsGiven inorder and postorder traversal of a tree, construct the binar原创 2014-01-30 04:46:27 · 484 阅读 · 0 评论 -
Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal II Total Accepted: 4998 Total Submissions: 16087My SubmissionsGiven a binary tree, return the bottom-up level order traversal of its nodes' values. (ie,原创 2014-01-30 04:24:32 · 405 阅读 · 0 评论 -
Convert Sorted Array to Binary Search Tree
Convert Sorted Array to Binary Search Tree Total Accepted: 5997 Total Submissions: 18635My SubmissionsGiven an array where elements are sorted in ascending order, convert it to a height原创 2014-01-30 04:08:45 · 361 阅读 · 0 评论 -
Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search Tree Total Accepted: 5229 Total Submissions: 19480My SubmissionsGiven a singly linked list where elements are sorted in ascending order, conv原创 2014-01-30 03:59:53 · 363 阅读 · 0 评论 -
Balanced Binary Tree
Balanced Binary Tree Total Accepted: 6933 Total Submissions: 21938My SubmissionsGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree原创 2014-01-30 03:13:30 · 377 阅读 · 0 评论 -
Minimum Depth of Binary Tree
Minimum Depth of Binary Tree Total Accepted: 6481 Total Submissions: 22608My SubmissionsGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the s原创 2014-01-30 02:35:59 · 415 阅读 · 0 评论 -
Word Ladder II
Word Ladder II Total Accepted: 1864 Total Submissions: 22064My Submissions Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start原创 2014-01-30 01:41:25 · 570 阅读 · 1 评论 -
Path Sum
Path Sum Total Accepted: 6233 Total Submissions: 20973My SubmissionsGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along原创 2014-01-29 12:20:39 · 317 阅读 · 0 评论 -
Distinct Subsequences
Distinct Subsequences Total Accepted: 4132 Total Submissions: 17739My SubmissionsGiven a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a原创 2014-01-29 09:22:13 · 388 阅读 · 0 评论 -
Populating Next Right Pointers in Each Node
Populating Next Right Pointers in Each Node Total Accepted: 5874 Total Submissions: 17154My Submissions Given a binary tree struct TreeLinkNode { TreeLinkNode *left;原创 2014-01-29 08:46:45 · 343 阅读 · 0 评论 -
Best Time to Buy and Sell Stock III
Best Time to Buy and Sell Stock III Total Accepted: 4172 Total Submissions: 19287My SubmissionsSay you have an array for which the ith element is the price of a given stock on day i.De原创 2014-01-29 03:05:37 · 557 阅读 · 0 评论 -
Best Time to Buy and Sell Stock II
Best Time to Buy and Sell Stock II Total Accepted: 6524 Total Submissions: 18350My SubmissionsSay you have an array for which the ith element is the price of a given stock on day i.Des原创 2014-01-29 02:38:07 · 526 阅读 · 0 评论 -
Maximum Depth of Binary Tree
Maximum Depth of Binary Tree Total Accepted: 8605 Total Submissions: 19098My SubmissionsGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the l原创 2014-01-30 05:25:18 · 320 阅读 · 0 评论 -
Binary Tree Zigzag Level Order Traversal
Binary Tree Zigzag Level Order Traversal Total Accepted: 4281 Total Submissions: 16488My SubmissionsGiven a binary tree, return the zigzag level order traversal of its nodes' values. (ie原创 2014-01-30 05:35:47 · 351 阅读 · 0 评论 -
Binary Tree Level Order Traversal
Binary Tree Level Order Traversal Total Accepted: 6147 Total Submissions: 20353My SubmissionsGiven a binary tree, return the level order traversal of its nodes' values. (ie, from left to原创 2014-01-30 05:48:36 · 362 阅读 · 0 评论 -
Gray Code
Gray Code Total Accepted: 4541 Total Submissions: 14545My SubmissionsThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative in原创 2014-01-31 11:31:01 · 393 阅读 · 0 评论 -
Binary Tree Inorder Traversal
Binary Tree Inorder Traversal Total Accepted: 8234 Total Submissions: 24173My SubmissionsGiven a binary tree, return the inorder traversal of its nodes' values.For example:Given bina原创 2014-01-31 04:46:35 · 388 阅读 · 0 评论 -
Partition List
Partition List Total Accepted: 4859 Total Submissions: 18717My SubmissionsGiven a linked list and a value x, partition it such that all nodes less than x come before nodes greater than o原创 2014-02-01 03:20:31 · 345 阅读 · 0 评论 -
Restore IP Addresses
Restore IP Addresses Total Accepted: 3846 Total Submissions: 19574My SubmissionsGiven a string containing only digits, restore it by returning all possible valid IP address combinations.原创 2014-01-31 05:13:19 · 381 阅读 · 0 评论 -
Decode Ways
Decode Ways Total Accepted: 4316 Total Submissions: 28200My SubmissionsA message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2原创 2014-01-31 11:24:08 · 380 阅读 · 0 评论 -
Subsets II
Subsets II Total Accepted: 4686 Total Submissions: 17623My SubmissionsGiven a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements i原创 2014-01-31 11:05:51 · 405 阅读 · 0 评论 -
Reverse Linked List II
Reverse Linked List II Total Accepted: 4937 Total Submissions: 19604My SubmissionsReverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3原创 2014-01-31 05:34:24 · 423 阅读 · 0 评论 -
Unique Binary Search Trees
Unique Binary Search Trees Total Accepted: 6702 Total Submissions: 18812My SubmissionsGiven n, how many structurally unique BST's (binary search trees) that store values 1...n?For exam原创 2014-01-30 10:06:39 · 480 阅读 · 0 评论 -
Interleaving String
Interleaving String Total Accepted: 4089 Total Submissions: 22357My SubmissionsGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "原创 2014-01-30 09:39:18 · 441 阅读 · 0 评论 -
Validate Binary Search Tree
Validate Binary Search Tree Total Accepted: 6009 Total Submissions: 23796My SubmissionsGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined原创 2014-01-30 06:56:21 · 401 阅读 · 0 评论 -
Recover Binary Search Tree
Recover Binary Search Tree Total Accepted: 4188 Total Submissions: 19186My SubmissionsTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changin原创 2014-01-30 06:47:01 · 381 阅读 · 0 评论 -
Same Tree
Same Tree Total Accepted: 8118 Total Submissions: 19053My SubmissionsGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if原创 2014-01-30 06:08:29 · 413 阅读 · 0 评论 -
Symmetric Tree
Symmetric Tree Total Accepted: 7304 Total Submissions: 22577My SubmissionsGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, thi原创 2014-01-30 06:03:28 · 368 阅读 · 0 评论 -
Longest Consecutive Sequence
Longest Consecutive Sequence Total Accepted: 5315 Total Submissions: 20105My SubmissionsGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.原创 2014-01-28 08:53:35 · 370 阅读 · 0 评论 -
Palindrome Partitioning II
Palindrome Partitioning II Total Accepted: 4171 Total Submissions: 24310My SubmissionsGiven a string s, partition s such that every substring of the partition is a palindrome.Return th原创 2014-01-28 08:29:45 · 376 阅读 · 0 评论 -
Palindrome Partitioning
Palindrome Partitioning Total Accepted: 4853 Total Submissions: 19790My SubmissionsGiven a string s, partition s such that every substring of the partition is a palindrome.Return all p原创 2014-01-28 02:52:11 · 334 阅读 · 0 评论 -
Single Number II
Single Number II Total Accepted: 7073 Total Submissions: 22573My SubmissionsGiven an array of integers, every element appears three times except for one. Find that single one.Note:Yo原创 2014-01-28 01:03:53 · 495 阅读 · 0 评论 -
Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"原创 2014-01-27 10:57:58 · 358 阅读 · 0 评论 -
Linked List Cycle II
Linked List Cycle II Total Accepted: 5421 Total Submissions: 17912My SubmissionsGiven a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up原创 2014-01-27 08:45:51 · 297 阅读 · 0 评论 -
Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].Note: Recursive soluti原创 2014-01-27 08:09:11 · 342 阅读 · 0 评论 -
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 solut原创 2014-01-27 08:05:18 · 333 阅读 · 0 评论 -
Palindrome Number
题目:Determine whether an integer is a palindrome. Do this without extra space.一种是可以 reverse 整个 integer, 但会导致overflow, 更好的办法是头和尾逐个比较。 public static boolean checkPalindrome(int n) {原创 2014-01-27 04:31:46 · 346 阅读 · 0 评论 -
Word Break II
Word Break II Total Accepted: 3845 Total Submissions: 28410My SubmissionsGiven a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a val原创 2014-01-27 13:11:14 · 475 阅读 · 0 评论