- 博客(5)
- 收藏
- 关注
转载 【Leetcode】Longest Palindrome Substring
【题目】Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 【题解】 Mana
2014-11-29 11:25:48 409
原创 【Leetcode】Reverse word in a string
【题目】 Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". click to show clarification. Clarification: What con
2014-11-27 23:28:33 552
转载 【知识点】树的遍历
【树的定义】 public class TreeNode{ int val; TreeNode left; TreeNode right; TreeNode(int x){ val=x; } } 【前序遍历】 递归: public void preOrder(TreeNodebiTree){ System.out.printf(biTree.val+""); TreeNode leftTr
2014-11-26 16:36:27 471
原创 【Leetcode】Convert Sorted List to Binary Search Tree
【题目】Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 【思路】这道题目就和array不一样,因为是linkedlist所以,不能随意访问到中间的元素,那么就只能一步一步从头开始顺序访问,从列表到BST,我们能感受到构
2014-11-26 12:59:59 293
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人