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 ...
分类:
其他好文 时间:
2018-10-14 14:05:13
阅读次数:
139
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given t ...
分类:
其他好文 时间:
2018-10-08 23:17:21
阅读次数:
145
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 are n ...
分类:
编程语言 时间:
2018-10-07 14:44:22
阅读次数:
133
"题目链接" $Description$ $Solution$ 为了方便,我们将x坐标左右反转,再将所有高度取反,这样依然是维护从左到右的LIS,但是每次是在右边删除元素。 这样对于在p刚种的树,最多只有9棵树比它高,即它只会转移到这9棵树,除这9棵树外,它可以从1~p 1的任何树转移(其它9棵树除 ...
分类:
其他好文 时间:
2018-10-04 23:04:26
阅读次数:
345
F - Uniformly Branched Trees ...
分类:
其他好文 时间:
2018-10-04 15:20:21
阅读次数:
158
题目 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 id ...
分类:
其他好文 时间:
2018-10-02 17:39:32
阅读次数:
203
题目描述: We are all familiar with pre-order, in-order and post-order traversals of binary trees. A common problem in data structure classes is to find th ...
分类:
其他好文 时间:
2018-10-02 17:38:26
阅读次数:
144
题意 这道题题意就是给出第一象限的n*m个点,求出站在原点可以看见多少个点 (1<=n,m<=1^5) 题解 这个题很仪仗队差不多,不过仪仗队是正方形。 这个是长方形。。。 这题其实就是求互质的数对的对数。 我们,一个一个的枚举i,然后就是求跟i互质的数的个数。 然后这个求跟i互质的数的个数可以用容 ...
分类:
其他好文 时间:
2018-09-27 22:10:55
阅读次数:
144