上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 20 下一页
摘要: Given an array of integers and an integerk, find out whether there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the differe... 阅读全文
posted @ 2015-09-22 01:14 茜茜的技术空间 阅读(131) 评论(0) 推荐(0)
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr... 阅读全文
posted @ 2015-09-22 00:53 茜茜的技术空间 阅读(128) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2015-09-17 03:41 茜茜的技术空间 阅读(1) 评论(0) 推荐(0)
摘要: Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->... 阅读全文
posted @ 2015-09-17 02:52 茜茜的技术空间 阅读(153) 评论(0) 推荐(0)
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ... 阅读全文
posted @ 2015-09-17 01:53 茜茜的技术空间 阅读(1186) 评论(0) 推荐(0)
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedia: ... 阅读全文
posted @ 2015-09-17 00:54 茜茜的技术空间 阅读(142) 评论(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 sum.Fo... 阅读全文
posted @ 2015-09-17 00:11 茜茜的技术空间 阅读(140) 评论(0) 推荐(0)
摘要: 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 @ 2015-09-16 02:18 茜茜的技术空间 阅读(132) 评论(0) 推荐(0)
摘要: Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1解题思路:方法一: recursion 交换当前左右节点,并直接调用递归即可方... 阅读全文
posted @ 2015-09-14 03:02 茜茜的技术空间 阅读(117) 评论(0) 推荐(0)
摘要: 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 identical an... 阅读全文
posted @ 2015-09-14 02:07 茜茜的技术空间 阅读(108) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 20 下一页