https://vjudge.net/problem/UVA-10214 题意:你站在原点,每个坐标位置有一棵高度相同的树,问能看到多少棵树 ans=Σ gcd(x,y)=1 欧拉函数搞搞 ...
分类:
其他好文 时间:
2017-08-20 15:43:07
阅读次数:
112
Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binar ...
分类:
其他好文 时间:
2017-08-20 12:41:30
阅读次数:
184
Given a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values after r ...
分类:
其他好文 时间:
2017-08-20 12:31:33
阅读次数:
155
Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: recursive: ...
分类:
其他好文 时间:
2017-08-20 10:09:07
阅读次数:
155
一. 题目描写叙述 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node con ...
分类:
其他好文 时间:
2017-08-19 22:28:34
阅读次数:
203
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] 题意:找出二叉树一层的最大值解法:用BFS的方式遍历每... ...
分类:
其他好文 时间:
2017-08-19 22:14:21
阅读次数:
270
从一个list->BST 还要height balance 解题思路: 每次找中点作为root,将中点左边的作为左子树的节点,中点右边的作为右子树的节点。 但是考虑树要找中间节点, 所以我最开始的思路是: 将list 转换为一个vector, 然后就可以easy的找中点和左,右两个部分了。 但是有一 ...
分类:
其他好文 时间:
2017-08-19 21:09:05
阅读次数:
121
cmake_minimum_required(VERSION 3.0) project(Proj) #设置二进制可执行文件输出路径 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}/bin) #会自动创建目录 #... ...
分类:
其他好文 时间:
2017-08-19 20:07:14
阅读次数:
185
1.1.1. 相关概念 (1)Binary Log 当变量log_bin的值为ON时,MySQL将启用Binary Log,这将在data目录下产生类似mysql-bin.00001, mysql-bin.00002的二进制日志文件,这些文件记录了数据库中执行的各种操作。 binlog_format ...
分类:
数据库 时间:
2017-08-19 18:32:38
阅读次数:
283