Basic algorithm designs