Problem solving techniques for the design of algorithms