摘要: [抄题]: 求最多的联通的1的数量 Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizonta 阅读全文
posted @ 2018-03-11 21:25 苗妙苗 阅读(177) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: [暴力解法]: 时间分析: 空间分析 阅读全文
posted @ 2018-03-11 11:20 苗妙苗 阅读(177) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given 阅读全文
posted @ 2018-03-11 10:52 苗妙苗 阅读(150) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is 阅读全文
posted @ 2018-03-11 09:39 苗妙苗 阅读(250) 评论(0) 推荐(0)
摘要: [抄题]: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally 阅读全文
posted @ 2018-03-11 09:00 苗妙苗 阅读(142) 评论(0) 推荐(0)