1 / 628
文档名称:

Algorithms For Programmers-Ideas And Source Code(Jorg Arndt).pdf

格式:pdf   页数:628
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Algorithms For Programmers-Ideas And Source Code(Jorg Arndt).pdf

上传人:bolee65 2014/1/27 文件大小:0 KB

下载得到文件列表

Algorithms For Programmers-Ideas And Source Code(Jorg Arndt).pdf

文档介绍

文档介绍:Algorithms for programmers
ideas and source code
This document is work in progress: read the ”important remarks” near the beginning
Arndt
******@
Draft version1 of 2005-January-17
1The latest version and the panying software is online at /.
ii
[fxtbook draft of 2005-January-17]
CONTENTS iii
Contents
Important remarks about this document xv
I Low level binatorial algorithms 1
1 Bit wizardry 3
Trivia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Avoiding branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Operations on low bits or blocks of a word . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
the index of a single set bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Operations on high bits or blocks of a word . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Functions related to the base-2 logarithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Counting the bits of a word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Swapping bits or blocks of a word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Isolating blocks of bits and single bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Bit set lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Bitwise rotation of a word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Functions related to bitwise rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Reversing the bits of a word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Bitwise zip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Gray code and parity . . . . . . . . . . . . . . . . . . . . . . . . . .