Here is part(due to my careless maintaining)of the algorithm practices I've done since I was a high school kid.