码迷,mamicode.com
首页 >  
搜索关键字:num lock    ( 23499个结果)
int *p,cons int *p,int const *p,int * const p,const int * const p,int const * const p的区别
?? 加有const关键字的几种情况的辨析 const修饰的代码 含义(特点) 等价性 int *p = # 1.       可以读自己 2.       可以通过*p改自己 3.       可以通过p = &data来看别人...
分类:其他好文   时间:2014-08-01 02:25:50    阅读次数:226
java concurrent之ReentrantLock
在编码的过程中,有时候我们不得不借助锁同步来保证线程安全。synchronized关键字在上一篇博客中已经介绍;自从JDK5开始,添加了另一种锁机制:ReentrantLock。 二者的区别 1、lock是jdk5之后代码层面实现的,synchronized是JVM层面实现的。 2、synchronized在出现异常的时候能够自动释放锁,而lock必须在finally块中unlock()主动...
分类:编程语言   时间:2014-08-01 00:02:20    阅读次数:319
hdu 4901
一个简单的dp,比赛的时候太坚信自己的小聪明没用二维数组一直WA到死;#include#include#define maxn 1009#define mod 1000000007using namespace std;int num[maxn];long long ci[maxn][1026],a...
分类:其他好文   时间:2014-07-31 23:41:00    阅读次数:216
排序算法
1.冒泡排序void bubble_sort(int arr[], int num){ for(int i=0;iarr[j+1]){ //如果前面的数大于后面的数 int t=arr[j]; //交换两个数的位置,使小数下沉 ...
分类:其他好文   时间:2014-07-31 23:25:50    阅读次数:299
todo
1 #include 2 #include 3 #include 4 #include 5 #include 6 #define ll long long 7 using namespace std; 8 const int INF = 0x3f3f3f3f; 9 10 char num...
分类:其他好文   时间:2014-07-31 23:14:10    阅读次数:225
POJ 3321 Apple Tree (dfs+线段树)
题目大意: 修改树上的节点,然后求子树的和。 思路分析: dfs 重新编号,烂大街了。。。 #include #include #include #include #define maxn 100005 #define lson num<<1,s,mid #define rson num<<1|1,mid+1,e using namespace std; int num[...
分类:移动开发   时间:2014-07-31 20:46:27    阅读次数:251
UVa409_Excuses, Excuses!(小白书字符串专题)
解题报告 字典树爆。 #include #include #include using namespace std; int k,e,num[100],cnt; struct node { int v; node *next[26]; }; node *newnode() { node *p=new node; p->v=0; int i; ...
分类:其他好文   时间:2014-07-31 20:46:07    阅读次数:216
【CodeChef】Small factorials(BigInteger笔记)
You are asked to calculate factorials of some small positive integers.InputAn integer t, 1 0){20 int num = Integer.parseInt(bf.readLine())...
分类:其他好文   时间:2014-07-31 20:05:57    阅读次数:165
Oracle大数据SQL语句优化
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null 可以.....
分类:数据库   时间:2014-07-31 19:55:47    阅读次数:357
JDK读写锁ReadWriteLock的升级和降级问题
JDK提供了写锁接口ReadWriteLock和它的实现ReentrantReadWriteLock。要实现一个读写锁,需要考虑很多细节,其中之一就是锁升级和锁降级的问题。什么是升级和降级呢?ReadWriteLock的javadoc有一段话: Can the write lock be downgraded to a read lock without allowing an interven...
分类:其他好文   时间:2014-07-31 17:13:36    阅读次数:231
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!