* Goal I keep my sample code for the algorithm class I'm teaching at Northeastern Unviersity (CS5800). The goal of this is to help students better understand the algorithms and techniques I cover in class. Hence, I try to make the code expressive, without worrying about making it general. * Programming languages The code is written in C++/Python/Java. I use unit tests to verify the corretness of all algorithm implementations. Here are a list of unit test framework I use for each language. 1) C++: gtest/gmock. 2) Python: unittest lib. 3) Java: JUnit. * How to execute 1) C++: I've also used cmake to simplify the build process for C++, and supplied each example with a CMakeLists.txt file (tough you may need to update the reference location for gmock and gtest lib). In general, you can follow the following steps to run each example. mkdir mybuild cd mybuild cmake .. make ./test 2) Python: unit tests are in file test_*.py (e.g. test_qsort.py is the unit test for quick sort), to run them simply use python test_*.py 3) Java: unit tests are in file Test*.java (e.g. TestQuickSort.java is the unit test for quick sort), to run them simply use java Test* * Related environment settings # gmock export GMOCK_HOME=$HOME/lib/gmock-1.7.0 # cs5800 home directory export CS5800_HOME=$HOME/courses/neu-cs5800 export PYTHONPATH=PYTHONPATH:$CS5800_HOME # junit export JUNIT_HOME=$HOME/lib/junit export CLASSPATH=$CLASSPATH:$JUNIT_HOME/junit.jar export CLASSPATH=$CLASSPATH:$JUNIT_HOME/hamcrest-core.jar # apache common lang export COMMOM_LANG_HOME=$HOME/lib/commons-lang3-3.3.2 export CLASSPATH=$CLASSPATH:$COMMOM_LANG_HOME/commons-lang3-3.3.2.jar # javatuples export JAVATUPLES_HOME=$HOME/lib/javatuples-1.2 export CLASSPATH=$CLASSPATH:$JAVATUPLES_HOME/lib/javatuples-1.2.jar * Misc If you find any mistakes or have any suggestions, please reach me at austin.zhifeng.sun@gmail.com. -Zhifeng Sun