solved algorithm questions