一、GitHub地址: https://github.com/N006Unnamed/WC/tree/master 二、PSP表格 三、解题思路 1、主体: wc.exe 是一个常见的工具,它能统计文本文件的字符数、单词数和行数。要想实现统计字符数、单词数和行数就要对文本的内容进行扫描,记录与统计出 ...
分类:
其他好文 时间:
2019-09-25 22:19:58
阅读次数:
111
#序列分治 奇袭,优美序列(或tarjan+线段树优化建图) #整除分块: 砍树 #二进制拆分: 哪一天她能重回我身边 #扩展欧几里得: 方程的解 #中国剩余定理: visit(处理非素数模数) #循环矩阵: 随(rand)(原根优化),山洞 #DSU on tree: 模板(ac) #树上(权值) ...
分类:
编程语言 时间:
2019-09-25 19:56:46
阅读次数:
118
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the dep ...
分类:
其他好文 时间:
2019-09-25 12:15:45
阅读次数:
93
1 public TreeNode pruneTree(TreeNode root) { 2 dfs(root,null,-1); 3 return root; 4 } 5 6 public void dfs(TreeNode cur, TreeNode fa, int left) { 7 if (... ...
分类:
其他好文 时间:
2019-09-25 12:09:56
阅读次数:
98
问题描述 Given a binary tree, return the inorder traversal of its nodes' values. (左 - 根 - 右) Example: Follow up: Recursive solution is trivial, could you ...
分类:
其他好文 时间:
2019-09-25 10:42:33
阅读次数:
71
链接:https://leetcode-cn.com/problems/validate-binary-search-tree 给定一个二叉树,判断其是否是一个有效的二叉搜索树。 假设一个二叉搜索树具有如下特征: 节点的左子树只包含小于当前节点的数。节点的右子树只包含大于当前节点的数。所有左子树和右 ...
分类:
其他好文 时间:
2019-09-25 10:31:33
阅读次数:
61
1.对查询进行优化,要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.2000条以内的记录不建议做索引 3.最佳左前缀原则,联合索引的B+Tree是按照第一个关键字进行索引排列的。 4.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导 ...
分类:
数据库 时间:
2019-09-24 23:02:11
阅读次数:
175
题意 给出一颗树的括号序,有m个操作,每次交换两个括号,保证交换后括号序仍然合法,输出每次操作后(包括未操作时)树的直径 solution 首先转化题目,对于一棵树的括号序,我们找到一段子串,满足将其中匹配的括号消去后剩下的括号最多,那么剩下的括号个数即为所求直径 这样一棵树括号序为()(()) 取 ...
分类:
其他好文 时间:
2019-09-24 21:13:50
阅读次数:
93
Traverse an expression tree and extract parameters I think as you've said that using ExpressionVisitor works out to be a good approach. You don't need ...
分类:
其他好文 时间:
2019-09-24 19:21:37
阅读次数:
119
Easy A binary tree is univalued if every node in the tree has the same value. Return true if and only if the given tree is univalued. Example 1: Examp ...
分类:
其他好文 时间:
2019-09-24 17:26:33
阅读次数:
80