Seol mar théacs é seo: Greedy algorithms and Zipf laws