Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
Show Tags
Show Similar Proble...
分类:
其他好文 时间:
2015-08-14 01:11:52
阅读次数:
136
题目链接:
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=499题意:就是判断图中有无负环
SPFA,某个节点入队次数大于n就是有负环。代码:#include
#include
#include <string...
分类:
其他好文 时间:
2015-08-14 01:08:17
阅读次数:
174
题目链接:
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1310题意:
有m个卫星,n个站点,卫星可以不用代价相连,剩下要用无线电连,求无线电连接中最大距离的最小解法:
最小边开始加入,这样第n - m 条边的权值就是答案代码:略...
分类:
Web程序 时间:
2015-08-14 01:07:35
阅读次数:
214
Python练习题第 0004 题https://github.com/Show-Me-the-Code/show-me-the-code
第 0004 题:任一个英文的纯文本文件,统计其中的单词出现次数。Talk is cheap, show you my code.#! /usr/bin/env python
#! -*- coding: utf-8 -*-from collections i...
分类:
编程语言 时间:
2015-08-13 23:44:36
阅读次数:
244
mysql优化续:1:show index from table_name查看索引使用情况其中cardinality基数,即value group索引区分度,当cardinality越小时需要扫描的行数越多,越大是则越小。2:mysql评价索引扫描数据量非常大时可能会放弃使用,当使用limit时,情...
分类:
数据库 时间:
2015-08-13 23:37:19
阅读次数:
151
http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11562&courseid=0求n边形分解成三角形的方案数。就是求n-2个卡特兰数,从大神那盗取了一份模板,效率极高.同时也很复杂. 1 #include 2 #inclu...
分类:
其他好文 时间:
2015-08-13 21:48:26
阅读次数:
181
http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11560&courseid=0题意:总共有n天,每天yangyang都需要一个快乐值,有m个队友,每个队友都会给阳阳一个快乐值(为2的幂),并且只能给一次,如果某一天队友给的快乐...
分类:
其他好文 时间:
2015-08-13 21:47:22
阅读次数:
176
1.查询缓存优化你的查询show variables like "%query_cache%" //查看是否开启缓存开启命令:set global query_cache_type = 1;set global query_cache_size = 600000;2.EXPLAIN 你的 SELEC...
分类:
数据库 时间:
2015-08-13 20:01:16
阅读次数:
225
整理自:http://blog.51yip.com/mysql/1311.html显示创建表的信息:1 USE world;2 SHOW CREATE TABLE city;显示表结构信息:1 CREATE TABLE `city` (2 `ID` int(11) NOT NULL AUTO_I.....
分类:
数据库 时间:
2015-08-13 20:00:54
阅读次数:
121
+(void)showMessage:(NSString *)message{ UIWindow * window = [UIApplication sharedApplication].keyWindow; UIView *showview = [[UIView alloc]init]; show...
分类:
移动开发 时间:
2015-08-13 19:56:40
阅读次数:
145