algolrithims homework