上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
  2015年5月2日
摘要: 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 / \ 2 2... 阅读全文
posted @ 2015-05-02 10:40 黄瓜小肥皂 阅读(124) 评论(0) 推荐(0) 编辑
  2015年5月1日
摘要: You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place? 1 class Soluti... 阅读全文
posted @ 2015-05-01 11:06 黄瓜小肥皂 阅读(135) 评论(0) 推荐(0) 编辑
  2015年4月30日
摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo... 阅读全文
posted @ 2015-04-30 18:46 黄瓜小肥皂 阅读(141) 评论(0) 推荐(0) 编辑
  2015年4月28日
摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2015-04-28 17:14 黄瓜小肥皂 阅读(155) 评论(0) 推荐(0) 编辑
  2015年4月27日
摘要: Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文
posted @ 2015-04-27 17:50 黄瓜小肥皂 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.N... 阅读全文
posted @ 2015-04-27 16:47 黄瓜小肥皂 阅读(115) 评论(0) 推荐(0) 编辑
  2015年4月26日
摘要: Given a binary tree, determine if it is height-balanced.For this problem,a height-balanced binary tree is defined asa binary tree in which the depth o... 阅读全文
posted @ 2015-04-26 21:41 黄瓜小肥皂 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No... 阅读全文
posted @ 2015-04-26 18:55 黄瓜小肥皂 阅读(121) 评论(0) 推荐(0) 编辑
  2015年4月25日
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((... 阅读全文
posted @ 2015-04-25 10:43 黄瓜小肥皂 阅读(126) 评论(0) 推荐(0) 编辑
  2015年4月24日
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2015-04-24 11:32 黄瓜小肥皂 阅读(149) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页