"题目" 看题解的时候才突然发现$zky$讲过这道题啊,我现在怕不是一个老年人了 众所周知矩阵树求得是这个 $$\sum_{T}\prod_{e\in T}w_e$$ 而我们现在的这个问题有些鬼畜了,给定一棵树,求和这棵树有$k$条公共边的生成树个数 我们如何区分出和原生成树有几条边呢,容斥显然不是 ...
分类:
其他好文 时间:
2019-04-17 18:05:16
阅读次数:
239
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 ...
分类:
其他好文 时间:
2019-04-17 09:49:18
阅读次数:
145
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example ...
分类:
其他好文 时间:
2019-04-17 09:28:30
阅读次数:
142
You need to find the largest value in each row of a binary tree. Example: ...
分类:
其他好文 时间:
2019-04-16 13:07:18
阅读次数:
144
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Y ...
分类:
其他好文 时间:
2019-04-16 10:38:18
阅读次数:
175
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the ...
分类:
其他好文 时间:
2019-04-16 01:28:53
阅读次数:
181
Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, ...
分类:
编程语言 时间:
2019-04-15 23:23:39
阅读次数:
214
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 b... ...
分类:
其他好文 时间:
2019-04-15 20:29:09
阅读次数:
178
Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of al... ...
分类:
其他好文 时间:
2019-04-15 20:13:07
阅读次数:
111
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a... ...
分类:
其他好文 时间:
2019-04-15 19:54:40
阅读次数:
131