信号量的分类Mutual Exclusion Semaphores(互斥):一种特殊的二进制信号量,专门针对互斥操作进行了优化。Binary Semaphores(二进制):完成互斥、同步操作的最佳方式;速度最快,最常用。Counting Semaphores(计数):类似于二进制信号量,可记录信号...
分类:
其他好文 时间:
2014-08-27 16:10:07
阅读次数:
199
ActiveMQ中如果使用mysql innodb的同时,开启了binlog,那么在ack消息的时候,日志里就可会报错:java.sql.SQLException: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage...
分类:
数据库 时间:
2014-08-27 14:50:47
阅读次数:
2492
Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the cod...
分类:
其他好文 时间:
2014-08-27 14:45:48
阅读次数:
236
思想: 后序遍历。注意路径的连通: 结点不为空时要返回 max( max(leftV, rightV)+rootV, rootV);
分类:
其他好文 时间:
2014-08-27 14:21:47
阅读次数:
148
#define MAX 32 void IntToBinary(char binary[], int x); // x转换为二进制 void IntToBinary2(char binary[], int x); // 不同的思路可以有多种方法 void TrueForm(char binary[....
分类:
其他好文 时间:
2014-08-27 12:20:27
阅读次数:
180
题目地址:http://codeforces.com/contest/461/problem/B
题目大意:给一棵树,每个点为白色或黑色,切断一些边,使得每个连通块有且仅有一个黑点,问划分方案数。
算法讨论:TreeDP。f[x][0..1]表示x所在连通块有0/1个黑点。设y为x的儿子,则DP方程为f[x][1]=f[x][1]*f[y][0]+f[x][1]*f[y][1]+f[x][0]...
分类:
移动开发 时间:
2014-08-27 09:25:57
阅读次数:
287
LeetCode: Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equal...
分类:
其他好文 时间:
2014-08-27 00:07:27
阅读次数:
298
LeetCode: Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 ...
分类:
其他好文 时间:
2014-08-26 22:57:46
阅读次数:
220
创建 deb 后门安装包, 以常见程序 tree 为例进行说明, 接收第三方的安装包时, 一定要谨慎....
分类:
其他好文 时间:
2014-08-26 19:45:26
阅读次数:
308