#include #include #include #include void *thread1(void *arg){ printf("start thread (%u)\n", (unsigned)pthread_self()); printf("thread (...
分类:
其他好文 时间:
2014-09-27 01:39:38
阅读次数:
222
在senchaTouch 页面跳转中,有时我们需要将其前一个页面的相关参数传入到新的页面或者新的控件中,这是我们该如何传递参数进去呢,一下有两种方式:
var arg;//定义将要 传入的参数
Ext.define('MyApp.view.Init',{
extend:'Ext.Container',
id:'chat_more_btm',
xtype:'init',
config:{
...
分类:
其他好文 时间:
2014-09-26 23:11:21
阅读次数:
484
func_get_args() --返回函数中参数的数组func_num_args()--返回函数中参数的个数func_get_arg()--返回参数数组中的某一个 例如func_get_arg(0)表示第一个参数basename()--返回路径中的文件名部分dirname()--返回路径中的目录部...
分类:
其他好文 时间:
2014-09-26 21:59:48
阅读次数:
170
在递归函数中,加上max和min,保存当前子树的最大值和最小值
合法的二叉查找树:
1.左子树最大值
2.右子树最小值>根节点
3.子树均为合法的BST
bool isValidBST(TreeNode *root) {
if (!root) return true;
int max, min;
return isValid(root, m...
分类:
其他好文 时间:
2014-09-26 20:54:38
阅读次数:
131
从旅行商问题说起—— 给定一个图,n个节点(n>(v-1) & 1))//如果这个点还没有走过 { int val=DP(v,S | (1<<(v-1))); if (val!=INF) { dp[K][S]=min(dp[K][S],val+dist); } } } r...
分类:
其他好文 时间:
2014-09-26 20:28:18
阅读次数:
196
题目:hdoj 3001 Travelling
题意:标准的旅行商加一句话,每个点最多走两次。
分析:状态转移方程一模一样,只是要三进制,因为每个点有三种状态 0 ,1 2
定义状态:dp【st】【i】 :在状态为 st 时 当前在 i 点的最小花费
转移方程:dp【now】【j】 = min(dp【now】【j】,dp【st】【i】+mp【i】【j】);now是st可以一...
分类:
其他好文 时间:
2014-09-26 13:24:39
阅读次数:
179
/******** 环境: Apache2.2.8 + PHP5.2.6 + MySQL5.0.51b + jQuery-1.8.3.min.js ************** 其他组件:Zend_mail( Zend_framework 1.11.11 )******* Date:2014-09-...
分类:
Web程序 时间:
2014-09-26 02:01:08
阅读次数:
400
从一堆数中随机取出一些值的方法:#include #include #include #include using namespace std;int random(int min,int max){ return rand() % (max -min + 1) + min;}int main...
分类:
其他好文 时间:
2014-09-25 21:53:17
阅读次数:
189
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4283题解: 当最优解下, a1在j的位置排出, 则a2 ——aj-1 和 aj——an为两个独立事件, 状态转移方程: dp[i][i + j] = min(dp[i][i + j], dp[i + ....
分类:
其他好文 时间:
2014-09-25 21:41:37
阅读次数:
161
??
1
pthread_create()函数
创建线程
A:依赖的头文件
#include
B:函数声明
int pthread_create(pthread_t *thread, constpthread_attr_t *attr,
void *(*start_routine) (void *), void *arg);
pthread_t ...
分类:
编程语言 时间:
2014-09-25 19:01:47
阅读次数:
290