Basic Algorithm Design Techniques