摘要: 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 阅读全文
posted @ 2017-02-18 03:04 panini 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目: Implement int sqrt(int x). Compute and return the square root of x. 链接: http://leetcode.com/problems/sqrtx/ 2/14/2017, Java,不是自己想的。。。 二分法,需要进行第3行的 阅读全文
posted @ 2017-02-15 11:30 panini 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目: 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,- 阅读全文
posted @ 2017-02-12 10:43 panini 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2017-02-12 08:15 panini 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2017-02-10 06:30 panini 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2016-08-24 09:54 panini 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 题目: 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. 阅读全文
posted @ 2016-07-15 11:44 panini 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2016-07-05 07:22 panini 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题目: Invert a binary tree. to Trivia:This problem was inspired by this original tweet by Max Howell: 链接: http://leetcode.com/problems/invert-binary-tre 阅读全文
posted @ 2016-07-05 06:53 panini 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: 阅读全文
posted @ 2016-06-25 10:56 panini 阅读(141) 评论(0) 推荐(0) 编辑