Algorithm design and analysis