摘要: You need to find the largest value in each row of a binary tree. Example: Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9] /** * Definition for a binary 阅读全文
posted @ 2017-08-02 16:14 王早 阅读(126) 评论(0) 推荐(0)
摘要: Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth 阅读全文
posted @ 2017-08-01 17:32 王早 阅读(170) 评论(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: /** * Definition for a bi 阅读全文
posted @ 2017-08-01 11:33 王早 阅读(168) 评论(0) 推荐(0)