虽然读这本书是因为要准备面试,但是学到的远远不止于面试而已。当我下了随书的代码后,我惊讶于所有的代码都可以运行、测试,甚至自动画出性能图。
实验
- 下载书中的代码
svn co https://nutshellalgos.svn.sourceforge.net/svnroot/nutshellalgos nutshellalgos
- ubuntu下实战步骤
* install build environment
sudo apt-get install ant default-jdk
* install junit
~/lab$ ln -s /usr/share/java/ ./junit4.0
* build Java Code
cd Task
ant
cd ../
ant
* build C/C++ Code
cd ../Code
make; make test
* make figures
~/lab/nutshellalgos/Figures/scripts/chapter1$ make data
Computing Up, Down and Scattered. This may take a few minutes...
../../../Code/Chapter1/execute.sh UP > UP.f13
* figure2-8, figure2-9
sudo add-apt-repository ppa:plt/racket
sudo apt-get update
sudo apt-get install racket
参考资料
- Homepage of Algorithms in a Nutshell, http://shop.oreilly.com/product/9780596516246.do