do some algorithm exercises