Hacker-s Delight

Hacker-s Delight

作者:Henry S. Warren

出版社:Addison-Wesley Professional

出版年:2012-10-5

评分:9.2

ISBN:9780321842688

所属分类:行业好书

书刊介绍

内容简介

In Hacker's Delight, Second Edition, Hank Warren once again compiles an irresistible collection of programming hacks: timesaving techniques, algorithms, and tricks that help programmers build more elegant and efficient software, while also gaining deeper insights into their craft. Warren's hacks are eminently practical, but they're also intrinsically interesting, and sometimes unexpected, much like the solution to a great puzzle. They are, in a word, a delight to any programmer who is excited by the opportunity to improve. Extensive additions in this edition include * A new chapter on cyclic redundancy checking (CRC), including routines for the commonly used CRC-32 code * A new chapter on error correcting codes (ECC), including routines for the Hamming code * More coverage of integer division by constants, including methods using only shifts and adds * Computing remainders without computing a quotient * More coverage of population count and counting leading zeros * Array population count * New algorithms for compress and expand * An LRU algorithm * Floating-point to/from integer conversions * Approximate floating-point reciprocal square root routine * A gallery of graphs of discrete functions * Now with exercises and answers

精彩摘录

-x=~x+1=~(x-1)~x=-x-1-(~x)=x+1~(-x)=x-1x+y=x-(~y)-1=(x^y)+2*(x&y)=(x|y)+(x&y)=2*(x|y)-(x^y)x-y=x+~y+1=(x^y)-2*(~x&y)=(x&~y)-(~x&y)=2*(x&~y)-(x^y)x^y=(x|y)-(x&y)x&~y=(x|y)-y=x-(x&y)~(x-y)=y-x-1=~x+yx恒等于y=(x&y)-(x|y)-1=(x&y)+~(x|y)x|y=(x&~y)+yx&y=(~x|y)-~x

——引自第10页


这里是介绍

——引自章节:算法心得

相关推荐

微信二维码