Given n terms, print the k most frequent terms in descending order of their frequency.  Written using TDD.