Codes I wrote when I am learning algorithm