2014年6月13日

Leetcode:Binary Tree Zigzag Level Order Traversal

摘要: Description:Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next ... 阅读全文

posted @ 2014-06-13 21:37 soyscut 阅读(89) 评论(0) 推荐(0) 编辑

Leetcode:Partition List

摘要: Description:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preser... 阅读全文

posted @ 2014-06-13 21:29 soyscut 阅读(110) 评论(0) 推荐(0) 编辑

Leetcode:Count and Say

摘要: Description:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is re... 阅读全文

posted @ 2014-06-13 21:08 soyscut 阅读(135) 评论(0) 推荐(0) 编辑

Leetcode:Triangle

摘要: Decription:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, gi... 阅读全文

posted @ 2014-06-13 20:53 soyscut 阅读(295) 评论(0) 推荐(0) 编辑

Leetcode: Subsets & SubsetsII

摘要: Subsets Description:Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solu... 阅读全文

posted @ 2014-06-13 20:46 soyscut 阅读(168) 评论(0) 推荐(0) 编辑

2014年6月12日

Leetcode:Convert Sorted List to Binary Search Tree

摘要: Description :Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.分析:这道题目简单版是把一个排序好的数组转成平衡的二叉树... 阅读全文

posted @ 2014-06-12 11:55 soyscut 阅读(242) 评论(0) 推荐(0) 编辑

Leetcode:Unique Binary Search Trees & Unique Binary Search Trees II

摘要: Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a to... 阅读全文

posted @ 2014-06-12 11:22 soyscut 阅读(270) 评论(0) 推荐(0) 编辑

2014年6月8日

Leetcode::Longest Common Prefix && Search for a Range

摘要: 一次总结两道题,两道题目都比较基础Description:Write a function to find the longest common prefix string amongst an array of strings.分析: 这道题目最重要的知道什么叫prefix前缀, 否则一不小心就做... 阅读全文

posted @ 2014-06-08 23:16 soyscut 阅读(190) 评论(0) 推荐(0) 编辑

2014年6月7日

Leetcode::Flatten Binary Tree to Linked List

摘要: Description:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The... 阅读全文

posted @ 2014-06-07 20:55 soyscut 阅读(175) 评论(0) 推荐(0) 编辑

Leetcode::JumpGame

摘要: Description:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents... 阅读全文

posted @ 2014-06-07 20:18 soyscut 阅读(203) 评论(0) 推荐(0) 编辑

导航