比较
文章平均质量分 74
jmspan
这个作者很懒,什么都没留下…
展开
-
LeetCode 235. Lowest Common Ancestor of a Binary Search Tree(二叉搜索树的最低公共祖先)
原题网址:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.Accord原创 2016-04-06 06:33:46 · 686 阅读 · 0 评论 -
LeetCode 72. Edit Distance(编辑距离)
原题网址:https://leetcode.com/problems/edit-distance/Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)Y原创 2016-05-22 05:18:34 · 679 阅读 · 0 评论 -
LeetCode 275. H-Index II(文献)
原题网址:https://leetcode.com/problems/h-index-ii/Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?Hint:Expected runtime c原创 2016-04-13 12:14:37 · 551 阅读 · 0 评论 -
LeetCode 285. Inorder Successor in BST
原题网址:https://leetcode.com/problems/inorder-successor-in-bst/Given a binary search tree and a node in it, find the in-order successor of that node in the BST.Note: If the given node has no in原创 2016-04-15 00:35:29 · 1207 阅读 · 0 评论 -
LeetCode 161. One Edit Distance(编辑距离)
原题网址:https://leetcode.com/problems/one-edit-distance/Given two strings S and T, determine if they are both one edit distance apart.方法:两个字符串长度最多相差1,或者最多只有一个字符不同。public class Solution { publ原创 2016-05-25 01:40:56 · 1133 阅读 · 0 评论 -
LeetCode 100. Same Tree(相同的树)
原题网址:https://leetcode.com/problems/same-tree/Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identic原创 2016-05-23 00:49:13 · 414 阅读 · 0 评论 -
LeetCode 125. Valid Palindrome(校验对称)
原题网址:https://leetcode.com/problems/valid-palindrome/Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan,原创 2016-05-27 00:27:03 · 466 阅读 · 0 评论 -
LeetCode 162. Find Peak Element(查找峰值)
原题网址:https://leetcode.com/problems/find-peak-element/A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and ret原创 2016-05-25 01:40:48 · 2283 阅读 · 0 评论 -
LeetCode 163. Missing Ranges(缺失区间)
原题网址:https://leetcode.com/problems/missing-ranges/Given a sorted integer array where the range of elements are [lower, upper] inclusive, return its missing ranges.For example, given [0, 1, 3原创 2016-05-25 01:40:33 · 2301 阅读 · 0 评论 -
LeetCode 274. H-Index(文献)
原题网址:https://leetcode.com/problems/h-index/Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.Accordi原创 2016-04-13 10:58:01 · 703 阅读 · 0 评论 -
LeetCode 165. Compare Version Numbers(比较版本)
原题网址:https://leetcode.com/problems/compare-version-numbers/Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0原创 2016-05-25 01:40:07 · 462 阅读 · 0 评论 -
LeetCode 270. Closest Binary Search Tree Value(二叉搜索树最接近值查找)
原题网址:https://leetcode.com/problems/closest-binary-search-tree-value/Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.Note:原创 2016-04-13 02:53:19 · 3028 阅读 · 0 评论 -
LeetCode 283. Move Zeroes(移动数字0)
原题网址:https://leetcode.com/problems/move-zeroes/Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For exam原创 2016-04-14 10:21:19 · 455 阅读 · 0 评论 -
LeetCode 280. Wiggle Sort(摇摆排序)
原题网址:https://leetcode.com/problems/wiggle-sort/Given an unsorted array nums, reorder it in-place such that nums[0] = nums[2] .For example, given nums = [3, 5, 2, 1, 6, 4], one possible ans原创 2016-04-14 07:27:02 · 919 阅读 · 0 评论 -
LeetCode 316. Remove Duplicate Letters(删除重复字母)
原题网址:https://leetcode.com/problems/remove-duplicate-letters/Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You mus原创 2016-04-23 05:51:58 · 2214 阅读 · 1 评论