摘要: Description:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: ... 阅读全文
posted @ 2015-06-19 16:49 Rosanne 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Description:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Code: 1 TreeNode* invertTr... 阅读全文
posted @ 2015-06-19 11:09 Rosanne 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Description:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the fo... 阅读全文
posted @ 2015-06-19 10:25 Rosanne 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Description:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ... 阅读全文
posted @ 2015-06-18 17:22 Rosanne 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Description:Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 uniqu... 阅读全文
posted @ 2015-06-18 17:09 Rosanne 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Description:Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size t... 阅读全文
posted @ 2015-06-18 16:49 Rosanne 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Description:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,G... 阅读全文
posted @ 2015-06-18 16:32 Rosanne 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Description:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2... 阅读全文
posted @ 2015-06-18 16:16 Rosanne 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Description:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are s... 阅读全文
posted @ 2015-06-17 19:06 Rosanne 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Description:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways c... 阅读全文
posted @ 2015-06-17 19:03 Rosanne 阅读(140) 评论(0) 推荐(0) 编辑