Algorithms For Programmers: Ideas And Source Code

E-Book Overview

This is a draft of a book about selected algorithms. The audience in mind are programmers who are interested in the treated algorithms and actually want to create and understand working and reasonably optimized code.

E-Book Content

Algorithms for programmers ideas and source code This document is work in progress: read the “important remarks” near the beginning J¨org Arndt [email protected] Draft version1 of 2008-January-19 1 The latest version and the accompanying software is online at http://www.jjj.de/fxt/. ii [fxtbook draft of 2008-January-19] CONTENTS iii Contents Important remarks about this document xi I 1 Low level algorithms 1 Bit wizardry 1.1 Trivia . . . . . . . . . . . . . . . . . . . . . . . 1.2 Operations on individual bits . . . . . . . . . . 1.3 Operations on low bits or blocks of a word . . 1.4 Isolating blocks of bits and single bits . . . . . 1.5 Computing the index of a single set bit . . . . 1.6 Operations on high bits or blocks of a word . . 1.7 Functions related to the base-2 logarithm . . . 1.8 Counting bits and blocks of a word . . . . . . 1.9 Bit set lookup . . . . . . . . . . . . . . . . . . 1.10 Avoiding branches . . . . . . . . . . . . . . . . 1.11 Bit-wise rotation of a word . . . . . . . . . . . 1.12 Functions related to bit-wise rotation * . . . . 1.13 Reversing the bits of a word . . . . . . . . . . 1.14 Bit-wise zip . . . . . . . . . . . . . . . . . . . . 1.15 Gray code and parity . . . . . . . . . . . . . . 1.16 Bit sequency . . . . . . . . . . . . . . . . . . . 1.17 Powers of the Gray code . . . . . . . . . . . . 1.18 Invertible transforms on words . . . . . . . . . 1.19 Moves of the Hilbert curve
You might also like

Introduction To Algorithms
Authors: Thomas H. Cormen , Charles E. Leiserson , Ronald L. Rivest , Clifford Stein    214    0


Concise Algorithmics: The Basic Toolbox
Authors: Mehlhorn K. , Sanders P.    131    0



Digital Image Processing
Authors: Bernd Jähne    144    0


современный фортран
Authors: Бартеньев О.    240    0


Algorithms For Computational Linguistics
Authors: Striegnitz K. , et al.    192    0


Tex For The Impatient
Authors: Abrahams P.W. , Hargreaves K.A. , Berry K.    165    0



Protocols For High Efficiency Wireless Networks
Authors: Andreadis A. , Giambene G.    139    0


Algorithms For Programmers Ideas And Source Code
Authors: Arndt J.    103    0