上一页 1 ··· 58 59 60 61 62 63 64 65 66 ··· 77 下一页
摘要: [抄题]: You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to 阅读全文
posted @ 2018-03-16 22:33 苗妙苗 阅读(141) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through t 阅读全文
posted @ 2018-03-16 18:30 苗妙苗 阅读(189) 评论(0) 推荐(0)
摘要: [抄题]: Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given tar 阅读全文
posted @ 2018-03-16 15:03 苗妙苗 阅读(174) 评论(0) 推荐(0)
摘要: [抄题]: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not 阅读全文
posted @ 2018-03-15 15:35 苗妙苗 阅读(122) 评论(0) 推荐(0)
摘要: [抄题]: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume th 阅读全文
posted @ 2018-03-14 22:46 苗妙苗 阅读(163) 评论(0) 推荐(0)
摘要: [抄题]: Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any 阅读全文
posted @ 2018-03-14 21:58 苗妙苗 阅读(157) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path 阅读全文
posted @ 2018-03-14 20:43 苗妙苗 阅读(182) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You 阅读全文
posted @ 2018-03-14 18:28 苗妙苗 阅读(285) 评论(0) 推荐(0)
摘要: [抄题]: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others 阅读全文
posted @ 2018-03-14 12:03 苗妙苗 阅读(236) 评论(0) 推荐(0)
摘要: [抄题]: Invert a binary tree. to [暴力解法]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: 以为要分为r.r = l.l, r.l = l.r来讨论,但是其实这样只能最后判断相等。翻转是每一步都要进行的动作,应该尽早开始 阅读全文
posted @ 2018-03-14 11:29 苗妙苗 阅读(131) 评论(0) 推荐(0)
上一页 1 ··· 58 59 60 61 62 63 64 65 66 ··· 77 下一页