Some code pieces of some algorithms.