上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 64 下一页
摘要: 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 longestpath betwee 阅读全文
posted @ 2017-12-15 10:10 __Meng 阅读(139) 评论(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 need t 阅读全文
posted @ 2017-12-14 19:30 __Meng 阅读(194) 评论(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 @ 2017-12-13 11:08 __Meng 阅读(214) 评论(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 ident 阅读全文
posted @ 2017-12-12 10:56 __Meng 阅读(157) 评论(0) 推荐(0)
摘要: You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane 阅读全文
posted @ 2017-12-11 10:10 __Meng 阅读(285) 评论(0) 推荐(0)
摘要: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: 以数组的形式返回每个层次上的节点的平均值 C++( 阅读全文
posted @ 2017-12-08 16:24 __Meng 阅读(176) 评论(0) 推荐(0)
摘要: 大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项。 n<=39 1 1 2 3 5... C++: 一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法 1 2 3 5... f(n)=f(n-1)+f(n-2)注意 f1=1 f2=2 阅读全文
posted @ 2017-12-07 10:52 __Meng 阅读(277) 评论(0) 推荐(0)
摘要: You are given a data structure of employee information, which includes the employee's unique id, his importance value and his directsubordinates' id. 阅读全文
posted @ 2017-12-07 10:24 __Meng 阅读(229) 评论(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 target. E 阅读全文
posted @ 2017-12-06 19:17 __Meng 阅读(153) 评论(0) 推荐(0)
摘要: Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2017-12-05 17:28 __Meng 阅读(219) 评论(0) 推荐(0)
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 64 下一页