Basic algorithm and data structure implementation.