不使用逻辑运算求得两数的最大值
摘要:
下面将介绍两个不使用逻辑运算求两数最大值的算法:算法一intmax(constint*p,constint*q) { intarray[]={*p,*q}; returnarray[(unsigned)(*p-*q)>>(sizeof(int)*8-1)]; }算法二intmax(constint*p,constint*q) { ... 阅读全文
posted @ 2009-05-06 09:02
DP.
阅读(284)
评论(0)
推荐(0)
浙公网安备 33010602011771号