菱纱梦

导航

2014年9月3日 #

Binary Tree Level Order Traversal II <leetcode>

摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For e... 阅读全文

posted @ 2014-09-03 20:48 菱纱梦 阅读(165) 评论(0) 推荐(0) 编辑

Rotate Image <leetcode>

摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路:首先左右翻转,然后按照左下,右上... 阅读全文

posted @ 2014-09-03 19:10 菱纱梦 阅读(135) 评论(0) 推荐(0) 编辑

Unique paths <leetcode>

摘要: A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文

posted @ 2014-09-03 16:57 菱纱梦 阅读(133) 评论(0) 推荐(0) 编辑

Plus One

摘要: Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文

posted @ 2014-09-03 16:26 菱纱梦 阅读(235) 评论(0) 推荐(0) 编辑

Pascal's Triangle <LeetCode>

摘要: Pascal's TriangleGivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,... 阅读全文

posted @ 2014-09-03 16:02 菱纱梦 阅读(134) 评论(0) 推荐(0) 编辑

Sort Colors <LeetCode>

摘要: Sort ColorsGiven an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the or... 阅读全文

posted @ 2014-09-03 15:58 菱纱梦 阅读(138) 评论(0) 推荐(0) 编辑

Merge Sorted Array <leetcode>

摘要: Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal... 阅读全文

posted @ 2014-09-03 10:42 菱纱梦 阅读(120) 评论(0) 推荐(0) 编辑

Symmetric Tree <LeetCode>

摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ ... 阅读全文

posted @ 2014-09-03 09:41 菱纱梦 阅读(145) 评论(0) 推荐(0) 编辑