Pātuhitia tēnei: Introduction to the design and analysis of algorithms