摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. https://leetcode.com/problems/convert-sorted-array-t 阅读全文
摘要:
题目: Implement int sqrt(int x). Compute and return the square root of x. 链接: http://leetcode.com/problems/sqrtx/ 2/14/2017, Java,不是自己想的。。。 二分法,需要进行第3行的 阅读全文
摘要:
题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,- 阅读全文
摘要:
题目: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted i 阅读全文
摘要:
题目: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 链接:https://leetcode.com/problems/roman 阅读全文
摘要:
题目: Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order r 阅读全文
摘要:
题目: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: 链接: http://leetcode. 阅读全文
摘要:
题目: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikip 阅读全文
摘要:
题目: Invert a binary tree. to Trivia:This problem was inspired by this original tweet by Max Howell: 链接: http://leetcode.com/problems/invert-binary-tre 阅读全文
摘要:
题目: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: 阅读全文