2.3 Practice: algorithms